Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Packing struct timeval

by zwon (Abbot)
on Nov 24, 2012 at 10:16 UTC ( #1005355=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my $timeout = pack( 'L!L!', $seconds, 0 );
    defined $socket->sockopt( SO_RCVTIMEO, $timeout )
      or die "Couldn't set timeout: $!";
  2. or download this
    use 5.010;
    use strict;
        tv.tv_usec = tv_usec;
        return newSVpv((char *) &tv, sizeof(struct timeval));

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1005355]
Approved by BrowserUk
Front-paged by kcott
[Corion]: The good posts on HN are the non-computing posts. Most of the other stuff is maybe relevant to you if you are 20 and live in Silicon Valley...
[Corion]: Two attributes that don't describe me.
[Corion]: Maybe I should also write a curator for HN or simply not read it anymore, like you do.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-07-24 13:30 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (354 votes). Check out past polls.