Forgive me, but how would you force it to reconnect without creating a new socket? If it's true that a whois server hangs up after each query, then reconnecting without creating a new socket seems like a good compromise.
Thanks, tadman.
| [reply] |
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] |