$timeout]
connect()ed or accept()ed. This
method takes one optional parameter: a timeout value in seconds. If
you don't specify a timeout, or an undef timeout, there will be no
timeout. It's that simple.
Net::Ident::lookup (SOCKET [, $timeout])
EXPORT_OK,
so you'll have to explicitly ask for it if you want the function
lookup to be callable from your program). You can pass the socket
using either a string, which doesn't have to be qualified with a package
name, or using the more modern FileHandle calling styles: as a glob or
preferably a reference to a glob. As in the method call, the Socket has
to be a connected TCP/IP socket, and the timeout is optional.
($username, $opsys, $error).
The $username is the remote username, as returned in the scalar context,
or undef on error.
The $opsys is the remote operating system as reported by the remote ident daemon, or undef on a network error, or ``ERROR'' when the remote ident daemon reported an error. This could also contain the character set of the returned username. See RFC1413.
The $error is the error message, either the error reported by the
remote ident daemon (in which case $opsys is ``ERROR''), or the
internal message from the Net::Ident module, which includes the
system errno $! whenever possible. A likely candidate is
``Connection refused'' when the remote site isn't running an ident
daemon, or ``Connection timed out'' when the remote site isn't
answering our connection request.
When $username has a value, $error is always undef, and vice versa.
Excersize this server by telnetting to it, preferably from a machine that has a suitable ident daemon installed.
select() call (the 4-argument version of select(), but I
didn't need saying that, did I?). This interface is completely object
oriented. The following methods are available:
If you want to implement your own timeout, that's fine. Simply throw away the object when you don't want it anymore.
Returns undef on error, like when the SOCKET isn't a TCP/IP connected socket. Actually, in a list context, will return a list where the error message is the second element of the list.
The timeout is not implemented using alarm(). In fact you can
use alarm() completely independant of this library, they do not
interfere.
$blocking]
If you didn't call query $obj yet, this method calls it for you, which means it can block, regardless of the value of $blocking, depending on whether the connection to the ident is writable.
Obviously, you are supposed to call this routine whenever you see that the connection to the ident daemon is readable, and act appropriately when this returns true.
Note that once ready returns true, there are no longer checks on timeout (because the networking part of the lookup is over anyway). This means that even ready $obj can return true way after the timeout has expired, provided it returned true at least once before the timeout expired. This is to be construed as a feature.
[this release wasn't called Net::Ident, of course, it was called rfc931.pl]