in reply to Re: Threaded sockets, etc.
in thread Threaded sockets, etc.

Oh I forgot to mention that when it's not a timeout, when it's a proper disconnect, everything works fine and gets EOF and exits properly, the thread dies properly, etc. Basically it's just
while(1) { while (my $connection = $main->accept) { threads->create(\&initplayer,$connection); }
then
sub initplayer { my $hand = shift; $hand->blocking(0); print "INITPLAYER CALLED!\n"; threads->detach; doplayer($hand,$hand,$hand); remove_player($hand); print "THREAD DESTROYED!\n"; $hand->close(); }
and doplayer contains the code I posted before. I added a print line inside the while loop and it continues to print after the timeout, so it's not a blocking issue.