in reply to (OT) Webserver settings

You have to somehow configure your server to listen on the ip of the server, not localhost.

A quick testing shows that, it will not work otherwise, although you can access from localhost.

server.pl

use IO::Socket::INET; my $s = IO::Socket::INET->new(Proto => "tcp", LocalAddr => $ARGV[0], L +ocalPort => 8080, Listen => 10) || die "failed"; $s->accept(); print "accepted\n";

client.pl

use IO::Socket::INET; my $c = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $ARGV[0], Pe +erPort => 8080) ||die "failed";

Say the name of your computer is Blah. Then:

perl -w server.pl localhost perl -w server.pl Blah
perl -w client.pl localhost Works Doesn't work
perl -w client.pl Blah Doesn't Work Works

Replies are listed 'Best First'.
Re^2: (OT) Webserver settings
by Anonymous Monk on Sep 06, 2005 at 04:38 UTC
    Thanks very much for the script. I tried this with the following out come perl -w server.pl localhost outcome: failed perl -w server.pl valera outcome: failed perl -w client.pl localhost outcome: accepted perl-w client.pl valera outcome: accepted Was this an expected outcome? Thanks NLC