in reply to Re^2: golf challenge: one-liner netcat clone
in thread golf challenge: one-liner netcat clone
I take back my comment about write-blocking ("I don't see a check to see how much can be written without blocking"). I forgot to factor in that non-blocking applies to writing too.
So you don't have a problem with syswrite, but you do have a problem with sysread. If the sysread would block, it'll return undef, and your program will exit prematurely.
On Linux, setting the sockets and pipes to non-blocking doesn't seem to be required at all, but I am not sure it other Unixes will perform the same.
Nonsense. Imagine if the remote end does
print while <>;
If you try reading from the socket, your program will become permanently blocked.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: golf challenge: one-liner netcat clone
by salva (Canon) on Dec 11, 2011 at 08:57 UTC | |
by ikegami (Patriarch) on Dec 11, 2011 at 09:32 UTC |