Networking example?

BlitzMax Forums/BlitzMax Programming/Networking example?

jhague(Posted 2004) [#1]
I'd like to see a simple example of setting up a client and server on the same machine and having them exchange messages (via TCP, UDP or both). I know how to do this, just not in Blitz!


{cYan|de}(Posted 2004) [#2]
no udp or tcp in max yet :O, well basic socket stuff but thats it atm


jhague(Posted 2004) [#3]
That's fine. I'm sure it will be there eventually.

Any examples using winsock from Blitz? It's Windows-only, sure, but it will work for now.


jhague(Posted 2004) [#4]
To answer my own question, it's in the stdc.bmx module, which is included by default. See the socket_ function.

[Edit]
"socket_" is the low level function. For the easy way to write a network client, see the SocketStream module. For an example, see the HttpStream module. I wrote up a working example last night, communicating with a server written in Rebol. It took a couple of lines of code each for the client and server.