Hello!
I'm really new to networking and currently experimenting a little bit.
What I'm currently try to achieve is to listen to a local port and receive data that I'm sending using telnet.
I'm using the following BlitzMax source:
Graphics 640,480
Local socket:TSocket = CreateTCPSocket()
Local stream:TSocketStream = CreateSocketStream(socket)
If BindSocket(socket, 9090)
SocketListen(socket)
While (Not KeyDown(KEY_ESCAPE))
Cls
DrawText "Listening...", 10, 10
If SocketReadAvail(socket) > 0
DrawText "Receiving", 30, 10
Print "Receiving...."
Local data:String = ReadString(stream, SocketReadAvail(socket)) Print data
End If
Flip
Wend
Else
Print "fail"
End If
On the shell I open a connection using:
telnet localhost 9090
But when I'm typing and sending data, the BlitzMax client seems to never receive anything.
Greetz... Joe
|