in reply to Using MultiHomed not working in IO::Socket::INET?
Looking at the code, MultiHomed only works when an addresses is specified in PeerAddr/PeerHost (as opposed to using connect like you did), and it only works when a domain name is specified (as opposed to an IP address like you did). Try:
#!/usr/bin/perl use IO::Socket::INET; my $sock = IO::Socket::INET->new( Proto => 'tcp', PeerAddr => 'alistapart.com', PeerPort => 'http', MultiHomed => 1, Blocking => 1, Type => SOCK_STREAM, ) or die("Unable to connect: $!\n"); $sock->send(qq{GET / HTTP/1.0\r\n\r\n}); $sock->recv($buffer, 1024); print $buffer . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using MultiHomed not working in IO::Socket::INET?
by vancetech (Beadle) on May 24, 2006 at 22:09 UTC |