http://qs321.pair.com?node_id=820371


in reply to Re^2: IO Socket buffer flushing
in thread IO Socket buffer flushing

TCP provides a stream of bytes. You need to do your own record delimiting. readline works because it waits until a delimiter is found.

If you need a sysread version (perhaps so you can use select), see Re^3: Can a socket listen for multiple hosts? for an example.