I'm trying to write a package that does a non-blocking multi-homed connect using IO::Socket::INET. As I understand it, IO::Socket::INET cannot connect to a multi-homed host when set to non-blocking mode:
Although it is not illegal, the use of "MultiHomed" on a socket which is in non-blocking mode is of little use. This is because the first connect will never fail with a timeout as the connect call will not block.
The package holds a copy of the socket and a list of the multi-homed IP addresses. If the connection attempt timesout or is refused, I try the next IP in the list.
The problem I'm having is that I can't reuse the socket I created after the first connect call. When I create a new IO::Socket::INET object within the package, I get the error "can't call method "foo" on an unblessed reference".
Is there a way to reuse the IO::Socket::INET object?
Can I associate a new IO::Socket::INET object to the class until all the IP addresses are exausted, or the connection attempt succeeds. How can I do this without unblessing?
In reply to Multihoming a non-blocking IO::Socket::INET by vancetech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |