Im really understanding hows this works, I have used the old Blitz3D TCPStream, but this is different, can someone tell me if there is something wrong in this code, because the Client side connects even know there isn't a host avalible..
Strict Global TCP_SERVER Global TCP_STREAM Global ANSWER Global Player Function HostGame(port:Int) Local socket Local stream Print "Connecting..." socket = CreateTCPSocket() stream = CreateSocketStream(socket) BindSocket socket,port SocketListen socket,10 Print "Connected" TCP_SERVER = socket Return stream End Function Function JoinGame(host:String,port:Int) Local socket Local stream Print "Connecting..." socket = CreateTCPSocket() stream = CreateSocketStream(socket) BindSocket socket,port ConnectSocket socket,HostIp(host),port If SocketConnected(socket)=True Print "Connected" Else Print "Error connection failed to host!!" EndIf TCP_SERVER = socket Return stream End Function