Re: New to network programming a couple questions:
No. The operating system will only tell you there is data once it's arrived, no matter how long it took to get there. You just have to copy it over, which takes the same amount of time whether they're on your local LAN or a 1200bps modem from 1983.
Most muds use the select() function to be told which sockets have data waiting, and have a local buffer for each socket. When the data is ready on a socket, read it and add it to the end of the buffer. If the buffer contains enough data to read a command out of it, read it and process it, taking the data out of the buffer. Repeat for as many commands as you can read, and for as many sockets have got new data.
|