in reply to Re: Re: flushing sockets
in thread flushing sockets

This line waits forever for input:
while(@bits = $selectFD->can_read)
and then this line pauses for a tenth of second for no apparent reason:
select(undef, undef, undef, 0.1);
What you probably want to do is:
@bits = $selectFD->can_read(30); if (@bits == 0) { # we timed out } else { for (@bits) { blah blah blah } }

Replies are listed 'Best First'.
Re: Re: Re: Re: flushing sockets
by scuzzy (Novice) on Feb 18, 2003 at 10:22 UTC
    As it is a good setup for timoutes, the problem being that if the sockets drops for some reason, the timouts cease, wich means that it can't re-establish the link, wich is the whole point of the timeout... Any other idea's?