I'm basically writing a simple socket server and client in Perl, and could not find documentation on the client end after making a connect() call, it is obvious a port number is automatically selected and used on the client side to connect to a peer host:peer port.
I want to write out to a log, what client source port was used to connect out; but couldn't find info on a way to get this information in perl.
Basically I would like to log this info like:
print FILE time . " Connecting from 192.168.0.1:42244 to 192.168.0.10:443\n";
Does anyone know how to pull client-side source IP and source port from a client side socket in Perl ?