Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/BasicSocket/getsockopt-i.ri
Arrière
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
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0.03 |
proxy
|
phpinfo
|
Réglages