in reply to IO::Select can_read and windowing

from memory...when you access can_read and get a true it then automatically resets to false until your next client sends data...so, just keep on reading until eof or whatever from the socket once you have can_read = true.

Replies are listed 'Best First'.
Re: Re: IO::Select can_read and windowing
by Marcello (Hermit) on Jun 19, 2003 at 14:25 UTC
    Thanks aquarium,

    But the problem is that I need to use blocking reads, so if I have read one command and issue another read, the server blocks until the next command is completely read. Is there a way to tell how many bytes can be read? I then can use this to determine if I should do another read? Or maybe another IO::Select function to determine if I've read all the data?

    Kind regards
Re^2: IO::Select can_read and windowing
by Aristotle (Chancellor) on Jun 20, 2003 at 20:18 UTC
    I quote man 2 select:
    Three independent sets of descriptors are watched. Those listed in readfds will be watched to see if characters become available for reading (more precisely, to see if a read will not block - in particular, a file descriptor is also ready on end-of-file), those in writefds will be watched to see if a write will not block, and those in exceptfds will be watched for exceptions. On exit, the sets are modifiedin place to indicate which descriptors actually changed status.
    That seems to indicate behaviour as Marcello expected.

    Makeshifts last the longest.