W
Wolfram Humann
I'm using RPC::Lite to exchange data between two programs. I noticed
that when I run the client on the same machine as the server, I am
able to connect using the machine's name but not 'localhost'.
RPC::Lite uses IO::Socket and I found that I see the same problem with
the following command-line:
mymachine:/tmp> perl -MData:
ump=pp -MIO::Socket -E'$sock =
IO::Socket::INET->new( Proto => "tcp", PeerAddr => "mymachine",
PeerPort => 1700); pp $sock'
do {
require Symbol;
my $a = bless(Symbol::gensym(), "IO::Socket::INET");
*{$a} = {
io_socket_domain => 2,
io_socket_proto => 6,
io_socket_timeout => undef,
io_socket_type => 1,
};
$a;
}
mymachine:/tmp> perl -MData:
ump=pp -MIO::Socket -E'$sock =
IO::Socket::INET->new( Proto => "tcp", PeerAddr => "localhost",
PeerPort => 1700); pp $sock'
undef
mymachine:/tmp> perl -MData:
ump=pp -MIO::Socket -E'$sock =
IO::Socket::INET->new( Proto => "tcp", PeerAddr => "127.0.0.1",
PeerPort => 1700); pp $sock'
undef
Any idea why this is the case or how to further debug?
Thanks,
Wolfram
that when I run the client on the same machine as the server, I am
able to connect using the machine's name but not 'localhost'.
RPC::Lite uses IO::Socket and I found that I see the same problem with
the following command-line:
mymachine:/tmp> perl -MData:
IO::Socket::INET->new( Proto => "tcp", PeerAddr => "mymachine",
PeerPort => 1700); pp $sock'
do {
require Symbol;
my $a = bless(Symbol::gensym(), "IO::Socket::INET");
*{$a} = {
io_socket_domain => 2,
io_socket_proto => 6,
io_socket_timeout => undef,
io_socket_type => 1,
};
$a;
}
mymachine:/tmp> perl -MData:
IO::Socket::INET->new( Proto => "tcp", PeerAddr => "localhost",
PeerPort => 1700); pp $sock'
undef
mymachine:/tmp> perl -MData:
IO::Socket::INET->new( Proto => "tcp", PeerAddr => "127.0.0.1",
PeerPort => 1700); pp $sock'
undef
Any idea why this is the case or how to further debug?
Thanks,
Wolfram