Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/BasicSocket/setsockopt-i.ri
Arrière
U:RDoc::AnyMethod[iI"setsockopt:ETI"BasicSocket#setsockopt;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"LSets a socket option. These are protocol and system specific, see your ;TI",local system documentation for details.;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.;To;;0; [o; ; [I"I+optval+ is the value of the option, it is passed to the underlying ;TI"Isetsockopt() as a pointer to a certain number of bytes. How this is ;TI"done depends on the type:;To;;;;[o;;0; [o; ; [I"GInteger: value is assigned to an int, and a pointer to the int is ;TI"(passed, with length of sizeof(int).;To;;0; [o; ; [I"Itrue or false: 1 or 0 (respectively) is assigned to an int, and the ;TI"Hint is passed as for an Integer. Note that +false+ must be passed, ;TI"not +nil+.;To;;0; [o; ; [I"BString: the string's data and length is passed to the socket.;To;;0; [o; ; [I"4+socketoption+ is an instance of Socket::Option;T@S;; i;I" Examples;T@o; ; [I"HSome socket options are integers with boolean values, in this case ;TI"+#setsockopt could be called like this:;To:RDoc::Markup::Verbatim; [I"0sock.setsockopt(:SOCKET, :REUSEADDR, true) ;TI"Dsock.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true) ;TI"Lsock.setsockopt(Socket::Option.bool(:INET, :SOCKET, :REUSEADDR, true)) ;T:@format0o; ; [I"HSome socket options are integers with numeric values, in this case ;TI"+#setsockopt could be called like this:;To;; [I"%sock.setsockopt(:IP, :TTL, 255) ;TI">sock.setsockopt(Socket::IPPROTO_IP, Socket::IP_TTL, 255) ;TI"@sock.setsockopt(Socket::Option.int(:INET, :IP, :TTL, 255)) ;T;0o; ; [I"NOption values may be structs. Passing them can be complex as it involves ;TI"Kexamining your system headers to determine the correct definition. An ;TI"Mexample is an +ip_mreq+, which may be defined in your system headers as:;To;; [ I"struct ip_mreq { ;TI"& struct in_addr imr_multiaddr; ;TI"& struct in_addr imr_interface; ;TI"}; ;T;0o; ; [I"8In this case #setsockopt could be called like this:;To;; [I"/optval = IPAddr.new("224.0.0.251").hton + ;TI"C IPAddr.new(Socket::INADDR_ANY, Socket::AF_INET).hton ;TI"Ksock.setsockopt(Socket::IPPROTO_IP, Socket::IP_ADD_MEMBERSHIP, optval);T;0: @fileI"ext/socket/basicsocket.c;T:0@omit_headings_from_table_of_contents_below0I"Asetsockopt(level, optname, optval) setsockopt(socketoption) ;T0[ I"(p1, p2, p3);T@kFI"BasicSocket;TcRDoc::NormalClass00
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0.13 |
proxy
|
phpinfo
|
Réglages