Socket optimisation

BlitzMax Forums/BlitzMax Beginners Area/Socket optimisation

If I remember correctly you should not send more than 512 bytes at a time. But that might be different on different platforms.
You shouldn't send LESS than 512 bits (64 bytes). There isn't really an upper limit to packet side since there's no way you can know the MTU (or congestion) of every device on the way to your destination (although a qualified guess would be a MTU of 1300 bytes).

It depends on whether the SocketStream is buffered, or whether it simply sends off packets as they arrive. The buffered operation is clearly faster, since you're wasting much less bandwidth. (Sending a double for instance is only 4 bytes, the minimum frame size of an Ethernet frame is 64 bytes, I don't recall if the headers down through the TCP/IP stack add 60 bytes worth of overhead, but if they don't the Ethernet driver will automatically pad the frame before sending out on the interface).