Subject: | bug(?) in IO::Socket |
Date: | Thu, 20 Mar 2008 13:41:43 +0100 |
To: | bug-IO [...] rt.cpan.org |
From: | Hajdú Zoltán <zhajdu [...] jasmin.hu> |
Hello!
Environment:
============
- IO::Socket 1.29
- Linux 2.6.23.1 SMP x86_64
- Perl v5.8.8 built for x86_64-linux-gnu-thread-multi
Description:
============
The usual way using setsockopt to define SOL_SOCKET / SO_SNDTIMEO and SO_RCVTIMEO was the following:
$socket->setsockopt(SOL_SOCKET, SO_[SND|RCV]TIMEO, pack("LL", <sec>, <msec>)) or die $!;
But i've noticed that on some systems this throws an "Invalid argument" error. All documents describes
they accepts two long integers as argument. There is no hint even at Google how to solve this problem.
Using pack("LLLL", <sec>, <msec>) solves the issue.
Yours sincerely:
Zoltan Hajdu