Inetd and getpeername

Is there any way, from within Ruby, to get the peer name of a process
started from inetd?

The getpeername method appears to only be defined for BasicSocket, and
$stdin is an IO object, not a BasicSocket object. In Ruby 1.7, I have
BasicSocket.for_fd, which I could use, but I need a solution for Ruby
1.6.7.

Any ideas?