LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 11-06-2011, 09:28 PM   #1
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

Rep: Reputation: 10
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.
 
Old 11-06-2011, 09:48 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,105

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
Quote:
Originally Posted by anishkumarv View Post
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.
 
Old 11-07-2011, 12:19 AM   #3
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

Original Poster
Rep: Reputation: 10
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.
 
Old 11-07-2011, 12:51 AM   #4
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,698

Rep: Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988Reputation: 1988
What happens if you use actual ip and port numbers instead of variables?
 
1 members found this post helpful.
Old 11-07-2011, 03:19 AM   #5
anishkumarv
Member
 
Registered: Feb 2010
Location: chennai - India
Distribution: centos
Posts: 289

Original Poster
Rep: Reputation: 10
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "WARNING: Re-reading the partition table failed with error 22: Invalid argument." ytd Linux - Newbie 6 01-26-2010 11:06 AM
clcok_get(CLOCK_MONOTONIC returns error "Invalid Argument" raghupv30 Linux - Kernel 1 11-19-2009 04:45 AM
Error while trying to mount NFS share: "Invalid argument" TheEvilHammer Linux - Software 2 11-12-2009 02:35 AM
"Invalid argument" error while mounting NFS partition montylee Programming 12 07-23-2009 01:36 PM
error: Error for wireless request "Set Mode" (8B06) : invalid argument "roaming" penguin chick Linux - Wireless Networking 5 08-22-2008 02:16 PM


All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration