For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > February 2006 > problem creating a socket









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author problem creating a socket
darkpaw

2006-02-02, 10:37 am

Hi, all.

I'm having a problem with a socket accepting inbound connections from outside of localhost. Here is the section of code I'm using to open the socket on server-side:

my $port=$arguments[0];
my $sock=new IO::Socket::INET(LocalAddr=>'127.0.0.1',
LocalPort=>$port,
Proto=>'tcp',
Reuse=>1,
Listen=>5);
my $client;
$sock->listen();
print"Server started on port $port\n";
while ($client=$sock->accept())
{
print "Got an inbound connection...$InCount\n";
# blahblahblah
}

This works fine from the localhost, but not from any remote machine. "netstat -l" shows that it is indeed listening on whatever port I open it on. Iptables is disabled. I cannot even see it remotely with an nmap scan. What am I doing wrong?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com