in reply to unclear TCP client session block
I think you need to close the connection in the thread that's running 'in the background'. Otherwise, the telnet client will wait for that duplicated connection to be closed, before it quits itself.
When I modify your code as follows, it works for me, i.e. telnet quits right away, as you expected:
sub sleeping { close shift; ... } ... elsif ( /^sleep|^s\n?\r?$/i ) { threads->create( \&sleeping, $client )->detach(); } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: unclear TCP client session block
by Evgenij (Initiate) on Aug 24, 2011 at 08:34 UTC |