in reply to Re: IO::Socket doing getpeername twice on every send?
in thread IO::Socket doing getpeername twice on every send?

Internally, IO::Socket passes around a seperate $sock for each connection. Well, I tested my change by taking the nonblock example from the Perl Cookbook, making it use persistent LISTEN sockets, and then adding the following code in the request handling sub.
print "GOT LEN " . length($client->peername) . "\n"; my($port, $ipaddr) = sockaddr_in($client->peername); print "GOT PORT $port\n";
I connected from multiple hosts, getting the right port each time, then restarted the listener, connected again from multiple hosts and still got the expected results from my inserted block of code.