How do I set `SO_RCVTIMEO` on a socket in Perl?
问题 If I try like this: my $sock = IO::Socket::INET->new( … ) or die "no socket for you"; defined $sock->setsockopt(SOL_SOCKET, SO_RCVTIMEO, 30) or die "setsockopt: $!"; then my script suffers death from "setsockopt: Invalid argument at [line 2]". The IO::Socket and perlfunc pods do not say, though perlfunc gives an example with TCP_NODELAY which makes it look like the above should work. ( quick note: I've answered my own question, as best I can, but certainly welcome a better answer. The most