<?xml version="1.0" encoding="windows-1252"?>
<node id="717340" title="Re^2: A Simple Socket Server Using 'inetd'" created="2008-10-15 16:50:35" updated="2008-10-15 16:50:35">
<type id="11">
note</type>
<author id="717338">
Sarten X</author>
<data>
<field name="doctext">
You can, though I'm not sure if there's any quirks to it (including how it behaves when not run from inetd)

&lt;code&gt;
	my $hersockaddr    = getpeername(STDOUT);
	my ($port, $iaddr) = sockaddr_in($hersockaddr);
	my $ip = inet_ntoa($iaddr);
&lt;/code&gt;

That gives you &lt;code&gt;$port&lt;/code&gt; and &lt;code&gt;$ip&lt;/code&gt; nicely ready to use.</field>
<field name="root_node">
544341</field>
<field name="parent_node">
633233</field>
</data>
</node>
