zwon has asked for the wisdom of the Perl Monks concerning the following question:
I want to set SO_RCVTIMEO option for a socket, but a problem is that underlying syscall wants struct timeval and depending on architecture it may be couple of 32-bit or 64-bit integers. So I can use
on 32-bit or$socket->sockopt(SO_RCVTIMEO, pack('LL', $seconds, 0));
on 64-bit.$socket->sockopt(SO_RCVTIMEO, pack('QQ', $seconds, 0));
My question is what is the way to determine if script run on 32-bit or 64-bit OS, and if there's a better way to create this structure?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: setting timeout for a socket
by BrowserUk (Patriarch) on May 16, 2011 at 04:32 UTC | |
by zwon (Abbot) on May 16, 2011 at 04:47 UTC |