Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: getsockopt truncating values to 256 bytes ?

by Yaribz (Beadle)
on May 21, 2022 at 12:03 UTC ( [id://11144042]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use constant {
      DARWIN_SYS_getsockopt => 118, # from bsd/kern/syscalls.master
      GETSOCKOPT_MAXLEN => 512, # enough for now I guess...
    ...
      my $rv=syscall(DARWIN_SYS_getsockopt,fileno($_[0]),$_[1],$_[2],$optv
    +al,$optlen);
      return $rv < 0 ? undef : substr($optval,0,unpack('i',$optlen));
    }
    
  2. or download this
    use Socket qw'PF_INET SOCK_STREAM IPPROTO_TCP inet_aton sockaddr_in';
    
    use constant {
    ...
    }else{
      print "This system doesn't seem to be affected by the problem (TCP_I
    +NFO length: $tcpInfoLength).\n";
    }
    
  3. or download this
    sub getsockopt_darwin_gen {
      return &CORE::getsockopt if(@_ < 4);
      my $optlen = pop;
    ...
      my $rv=syscall(DARWIN_SYS_getsockopt,fileno($_[0]),$_[1],$_[2],$optv
    +al,$optlen);
      return $rv < 0 ? undef : substr($optval,0,unpack('i',$optlen));
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144042]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-23 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found