⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
BasicSocket
/
Edit File: getsockopt-i.ri
U:RDoc::AnyMethod[iI"getsockopt:ETI"BasicSocket#getsockopt;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LGets a socket option. These are protocol and system specific, see your ;TI"Glocal system documentation for details. The option is returned as ;TI"a Socket::Option object.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"Parameters;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [ I"F+level+ is an integer, usually one of the SOL_ constants such as ;TI".Socket::SOL_SOCKET, or a protocol level. ;TI"FA string or symbol of the name, possibly without prefix, is also ;TI"accepted.;To;;0; [o; ; [ I"E+optname+ is an integer, usually one of the SO_ constants, such ;TI"as Socket::SO_REUSEADDR. ;TI"FA string or symbol of the name, possibly without prefix, is also ;TI"accepted.;T@S;; i;I" Examples;T@o; ; [I"HSome socket options are integers with boolean values, in this case ;TI"+#getsockopt could be called like this:;T@o:RDoc::Markup::Verbatim; [ I";reuseaddr = sock.getsockopt(:SOCKET, :REUSEADDR).bool ;TI" ;TI"Goptval = sock.getsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR) ;TI" optval = optval.unpack "i" ;TI"/reuseaddr = optval[0] == 0 ? false : true ;T:@format0o; ; [I"HSome socket options are integers with numeric values, in this case ;TI"+#getsockopt could be called like this:;T@o;; [ I",ipttl = sock.getsockopt(:IP, :TTL).int ;TI" ;TI"Boptval = sock.getsockopt(Socket::IPPROTO_IP, Socket::IP_TTL) ;TI"#ipttl = optval.unpack("i")[0] ;T;0o; ; [ I"OOption values may be structs. Decoding them can be complex as it involves ;TI"Kexamining your system headers to determine the correct definition. An ;TI"Oexample is a +struct linger+, which may be defined in your system headers ;TI"as:;To;; [ I"struct linger { ;TI" int l_onoff; ;TI" int l_linger; ;TI"}; ;T;0o; ; [I"8In this case #getsockopt could be called like this:;T@o;; [I".# Socket::Option knows linger structure. ;TI">onoff, linger = sock.getsockopt(:SOCKET, :LINGER).linger ;TI" ;TI"Foptval = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER) ;TI"(onoff, linger = optval.unpack "ii" ;TI"&onoff = onoff == 0 ? false : true;T;0: @fileI"ext/socket/basicsocket.c;T:0@omit_headings_from_table_of_contents_below0I"0getsockopt(level, optname) => socketoption ;T0[ I" (p1, p2);T@SFI"BasicSocket;TcRDoc::NormalClass00
Simpan