in reply to Re^2: Client Server
in thread Client Server
I'm not quite sure what you mean. Could you clarify?
Suppose that you've got the IP address, as returned by inet_ntoa, saved in a variable (say $ip_address), and suppose that you've got a filehandle for a logfile that's opened for writing (say $logfile_handle), then you can just do this (adding a timestamp as well for good measure):
... my $ip_address = inet_ntoa($iaddr); ... say $logfile_handle scalar localtime, " Connection from: $ip_address"; ...
Integrating this into the above server example should be straightforward.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Client Server
by Anonymous Monk on Jul 15, 2014 at 18:30 UTC |