tcp server problem

Blitz3D Forums/Blitz3D Programming/tcp server problem

flounder22001(Posted 2006) [#1]
i've decided to finally try my hand at creating an online game with blitz. I looked at the documentation to get a start and looked at online examples when i couldn't get the server to work.

game=CreateTCPServer(8067)
stream=AcceptTCPStream(game)
While KeyHit(1)=0
If ReadAvail(stream)
	s$=ReadString(stream)
	Print s
EndIf
Wend


is there anything wrong with the code? i've used it on other computers as well as my own, so i'm sure its not an issue about firewalls or restricted access.


flounder22001(Posted 2006) [#2]
never mind, figured it out


Sir Gak(Posted 2006) [#3]
So, what was the problem, that you figured out?


KuRiX(Posted 2006) [#4]
You must call the TCPAcceptStream every frame, and check if there is a new incoming connection then...

In the first post, he only checks for incoming stream one time, then looping...