It seems that I'm making assumptions about the functionality
of IO::Socket::INET that just aren't true. For example,
you can't really reconnect unless you jump through a
bunch of hoops. The $socket->connect() method, for example, is
no more robust than the internal one. You need to resolve
your addresses first using gethostbyaddr, which is
inconvenient, to say the least. So it can be done, but the
cost is too high to make it practical.
Maybe this will be fixed in an upcoming release.
In the interim, recreating the socket doesn't seem
like such a big deal after all. It will certainly work. | [reply] |
Yeah, it does work and works fine when I create a new socket for each request. I guess I just like persistent connections, like Apache::DBI, but this may not be possible with a socket.
Doing this I kind of feel like a script-kiddie, like I'm not really understanding what's happening, even though I can get it work and have read the docs, camel, and Cookbook entries on IO::Socket.
Oh well. I'm sure true socket enlightenment is close. . .
| [reply] |
In this case, you're not able to keep a connection open
because the WHOIS protocol does not allow it. HTTP, on
the other hand, has a "KeepAlive" feature which allows the
socket to remain open for other transmissions.
You may also want to look into the RWHOIS protocol, which
is supposed to be replacing the old, and very tired WHOIS. If
any functional improvements are to be made, this is where
they will occur.
| [reply] |