network socket help

BlitzMax Forums/BlitzMax Beginners Area/network socket help

I used UDP in BlitzPlus but now feel that TCP is more desirable in BlitzMax (I found it easier to identify the sender of packets without having to use recv_from).

I am starting to use sockets in BMAX as well. Compression of data only becomes usefull when your packets become either quite large and/or repetitive in their contents. Let the server manage every connection (in TCP) to other clients by checking each socket for readavail and reading up to a certain number of times per main loop (such as 20 or 1000, depending on the kind of server you're making). Simply define a packet structure and include some kind of data in the beginning of the packet as a header (such as the number of bytes in the rest of the packet and the "type" of packet) along with the rest of the data.