Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: poorly documented behaviour of readline() and IO::Select

by choroba (Abbot)
on Apr 28, 2010 at 10:57 UTC ( #837270=note: print w/ replies, xml ) Need Help??


in reply to poorly documented behaviour of readline() and IO::Select

I had a similar problem years ago. A server was communicating with several clients, but sometimes one line of the communication got lost somewhere. The sleep solution solved the problem, but even then I was not 100% sure the error did not occur rarely, time to time.


Comment on Re: poorly documented behaviour of readline() and IO::Select
Download Code
Re^2: poorly documented behaviour of readline() and IO::Select
by vsespb (Hermit) on Apr 28, 2010 at 11:04 UTC
    sleep here is just for example. correct solution would be read with sysread/syswrite and detect newline somehow. or develop protocol which not depends on delimiter for messages.
Re^2: poorly documented behaviour of readline() and IO::Select
by Anonymous Monk on Apr 28, 2010 at 20:59 UTC
    Also! if you use eof or eof() together with sysread sysread does not work! (line gets buffered to read it by readline()) !

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://837270]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-08-20 23:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (125 votes), past polls