G
I am attempting to establish a socket connection using the
IO::Socket::INET module and occasionally the socket creation fails
with the message "Operation now in progress". From what I understand,
this error can only happen when attempting to create a socket in non-
blocking mode, never in blocking mode. However, I have explicitly set
the Blocking parameter to 1.
So, my question is: what could be causing this error? Does
IO::Socket::INET ignore the Blocking parameter?
The OS is 64-bit Redhat Enterprise Linux 4; the version of perl is
5.8.5; the IO::Socket::INET is version 1.27.
Here is the portion of code where the problem happens
########################
$socket = new IO::Socket::INET(
PeerAddr => my.ip.address.com,
PeerPort => 5000,
Proto => 'tcp',
Type => SOCK_STREAM,
Timeout => 30,
Blocking => 1,
) ;
}
# Did the socket get created correctly?
if (!$socket)
{
LogError("Socket to $IP could not be created. "
. "Reason: $!") ;
exit
}
##########################
IO::Socket::INET module and occasionally the socket creation fails
with the message "Operation now in progress". From what I understand,
this error can only happen when attempting to create a socket in non-
blocking mode, never in blocking mode. However, I have explicitly set
the Blocking parameter to 1.
So, my question is: what could be causing this error? Does
IO::Socket::INET ignore the Blocking parameter?
The OS is 64-bit Redhat Enterprise Linux 4; the version of perl is
5.8.5; the IO::Socket::INET is version 1.27.
Here is the portion of code where the problem happens
########################
$socket = new IO::Socket::INET(
PeerAddr => my.ip.address.com,
PeerPort => 5000,
Proto => 'tcp',
Type => SOCK_STREAM,
Timeout => 30,
Blocking => 1,
) ;
}
# Did the socket get created correctly?
if (!$socket)
{
LogError("Socket to $IP could not be created. "
. "Reason: $!") ;
exit
}
##########################