LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Perl "Invalid argument error" (https://www.linuxquestions.org/questions/linux-newbie-8/perl-invalid-argument-error-912247/)

anishkumarv 11-06-2011 08:28 PM

Perl "Invalid argument error"
 
Hi ,

we have a issue in server, we are running a perl script to connect our clients, but we are not able to connect, every time we are getting the

Quote:

"Invalid argument error"
Even i checked all the necessary perl modules are i installed in this server,


Code:

#create the listen socket
my $listen_socket = IO::Socket::INET->new(
                            LocalAddr => $MOBILLLLE_Proxy,
                            LocalPort => $MOBILLLLE_ProxyPort,
                            Listen    => 1,
                            Proto    => 'tcp',
                            Reuse    => 1)
or die "Can't create listening socket at $MOBILLLLE_ProxyPort: $!\n";


the above mention code i used in this script, every time when i try to connect. iam getting this output

Quote:

Can't create listening socket at 5005: Invalid argument
Why iam getting this error.. Need your guidance to fix this issue.

TB0ne 11-06-2011 08:48 PM

Quote:

Originally Posted by anishkumarv (Post 4517687)
Hi ,
we have a issue in server, we are running a perl script to connect our clients, but we are not able to connect, every time we are getting the Even i checked all the necessary perl modules are i installed in this server,
Code:

#create the listen socket
my $listen_socket = IO::Socket::INET->new(
                            LocalAddr => $MOBILLLLE_Proxy,
                            LocalPort => $MOBILLLLE_ProxyPort,
                            Listen    => 1,
                            Proto    => 'tcp',
                            Reuse    => 1)
or die "Can't create listening socket at $MOBILLLLE_ProxyPort: $!\n";

the above mention code i used in this script, every time when i try to connect. iam getting this output Why iam getting this error.. Need your guidance to fix this issue.

Did you read the error??
Quote:

Originally Posted by anishkumarv
Can't create listening socket at 5005: Invalid argument

You've either got another program (or this one is not written correctly), using port 5005, or you're passing the socket creation module an INVALID ARGUMENT, as it's telling you.

Check the syntax of the module.

anishkumarv 11-06-2011 11:19 PM

i checked few things..as per your reply

netstat -a | grep 5005

there is no other proccess using 5005 port and and no other perl scripts running in this server.

and the syntax also right, dont know what mistake iam doing.

grail 11-06-2011 11:51 PM

What happens if you use actual ip and port numbers instead of variables?

anishkumarv 11-07-2011 02:19 AM

hi,

grail if i give IP means its working, :-)

then i checked my /etc/hosts file..in that instead of 127.0.0.1 | 127.0.o.1 my server provider put entry like this, now i changed the entry, and its now resolving using local host. thanks alot for your help and Tbone.


All times are GMT -5. The time now is 04:58 PM.