Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by choroba (Bishop)
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.

Replies are listed 'Best First'.
Re^2: poorly documented behaviour of readline() and IO::Select
by vsespb (Chaplain) 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?
[karlgoethebier]: hello jedikaiti! something shiny tonight?
[jedikaiti]: It's a very pretty shiney
[jedikaiti]: Shiney!
[karlgoethebier]: very nice!
[shmem]: hm. Can't resolve apod.nasa.gov - weird.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-11-21 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (308 votes). Check out past polls.

    Notices?