Not a GLOB reference at tcpserver4.pl line 43 (and 83).
Would you try the following changes:
use threads qw[ yield ]; ## Why (*&^^%) isn't that exported by default +? ... threads->create( ... ); yield; sleep 1; ## insert } ...
I just don't see that effect here. No matter how I break the connection--from quitting the client cleanly to killing the client process--the while( <$client> ) loop in the server terminates immediately, and so the thread ends.
This seems to be one of those infamous platform differences. On windows, there are timeouts for inter-character receipt, a per-byte-to-read timeout, and a total read timeout.
Looking at the man page for SetSockOpt(), you could try using SO_RCVTIMEO to set a maximum read timeout and see if that allowed the read to terminate.
Hm. It implies that on your platform, writing to a (dup of) a socket, whilst another thread is in a read state on it, goes ahead immediately.
That doesn't work on here. (At least for sockets as provided by IO::Socket::INET--it seem to work okay from C.)
I've been doing that too. My code (when it works:(), routes the commands using the UnitID input from the command client.
In reply to Re^5: Non closing sockets - threads
by BrowserUk
in thread Non closing sockets - threads
by igor1212
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |