Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: A Simple Socket Server Using 'inetd'

by Sarten X (Initiate)
on Oct 15, 2008 at 20:50 UTC ( #717340=note: print w/ replies, xml ) Need Help??


in reply to Re: A Simple Socket Server Using 'inetd'
in thread A Simple Socket Server Using 'inetd'

You can, though I'm not sure if there's any quirks to it (including how it behaves when not run from inetd)

my $hersockaddr = getpeername(STDOUT); my ($port, $iaddr) = sockaddr_in($hersockaddr); my $ip = inet_ntoa($iaddr);
That gives you $port and $ip nicely ready to use.


Comment on Re^2: A Simple Socket Server Using 'inetd'
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://717340]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2015-07-31 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls