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 (Canon)
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
Replies are listed 'Best First'.
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 romping around the Monastery: (7)
As of 2015-07-29 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls