in reply to Re^2: Socket descriptor passed across fork -- hanging
in thread Socket descriptor passed across fork -- hanging
until we uncovered the clients that didn't terminate their last line What?
They closed the socket before sending \r\n?
My code deals with that.
because you're using fixed-length packets, you avoid the actual problem that trapped me
No, not at all.
I thought that I explained clearly how to deal with an indeterminate length \r\n terminated packet.
What was not clear?
Obviously something was not.
It would help if you could ask the question in a different way.
Please look at: sysread. sysread() will return with a number of bytes read.
If the other side sends: "1234\r\n", just look at the end of the buffer to see if there is a line termination (last 2 bytes).
What's the problem?
I think that you can easily adapt my code to deal with your requirements.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Socket descriptor passed across fork -- hanging
by dd-b (Pilgrim) on Oct 13, 2011 at 17:47 UTC | |
by Marshall (Canon) on Oct 15, 2011 at 10:28 UTC | |
by Marshall (Canon) on Oct 15, 2011 at 17:26 UTC |