If you want to use TCP, use it via DLL, not the Blitzbasic variant.
In Blitzbasic TCP uses only "blocked" mode, which means every time there is a lag in the connection, your complete game is stopped, even the graphical part.
So the original TCP is only useful in fast and reliable networks which means LAN. But in this environment there won't be any packet loss with UDP either.
If you're an experienced programmer, you can go with UDP and handle possible packet loss by yourself. Otherwise you can use an external DLL which handles the network stuff...
----
Your code:
TCP builds up a steady connection only once. AcceptTCPStream is only used to accept new clients.
If you want to check if there is data available, use ReadAvail. EOF might work too.
In Blitzbasic TCP uses only "blocked" mode, which means every time there is a lag in the connection, your complete game is stopped, even the graphical part.
So the original TCP is only useful in fast and reliable networks which means LAN. But in this environment there won't be any packet loss with UDP either.
If you're an experienced programmer, you can go with UDP and handle possible packet loss by yourself. Otherwise you can use an external DLL which handles the network stuff...
----
Your code:
TCP builds up a steady connection only once. AcceptTCPStream is only used to accept new clients.
If you want to check if there is data available, use ReadAvail. EOF might work too.