in reply to Re: Trouble with sockets
in thread Trouble with sockets

Both machines are on the same network and not behind any firewalls. I can connect to and from these machines using other protocols such as telnet, ftp, UNC, etc. I think the problem is with the winnt4 machine running the server code, since I don't see a connection using netstat -a. I believe I should see an entry for that port listed as 'Listening'.

Thanks!

Sweetblood

Replies are listed 'Best First'.
Re^3: Trouble with sockets
by pbeckingham (Parson) on Jun 21, 2004 at 15:00 UTC

    My machines were both in the same room, on the same router and subnet. Firewall software on both machines (Linux and OS X) prevented the connection.

Re^3: Trouble with sockets
by tachyon (Chancellor) on Jun 22, 2004 at 05:01 UTC

    This code will give you a functional server you can telnet into. Don't use it for anything but testing:

    #!/usr/bin/perl -w use strict; use IO::Socket; my $sock = IO::Socket::INET->new( Listen => 1, LocalAddr => 'localhost', LocalPort => 9000, ) || die "Unable to create socket: $!\n"; print "Waiting for message...\n"; while ( my $fh = $sock->accept()) { print while <$fh>; } close ($sock);

    cheers

    tachyon