Hello,

I'm working on a ruby daemon running through inetd.
Inetd opens the script with STDIN and STDERR replaced by dups of the
socket. It works fine, but I'd like to retreive the remote address.
Since Ruby consider these as IO objects, I can't call peeraddr.

The best I could get was this:
Socket.for_fd(0).getpeername
But it returns the raw struct sockaddr.

Unfortunatly, there is no IPSocket.for_fd.

Is there a way to obtain the peer address directly?
Else, how could I unpack the struct sockaddr to get it?

Thanks,
Mike.