I have a problem with my Perl server. Clients connect and send command terminated by a newline. The server uses IO::Select's can_read to determine if there's any data to read. If so, it reads all data up to the first newline.
The problem is when a client sends two or more commands at once. The server reads the first command, but after that can_read returns false although there is still data available. Why is can_read returning false when I only read a part of the total data (one command at a time)?
More info: it's a Linux machine, the perl server uses IO::Socket. Reading is done byte for byte, because commands can have different end characters (e.g. newline, ETX etc.)