REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.14 KB
Close
/proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/BasicSocket/getsockopt-i.yaml
Text
Base64
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Gets a socket option. These are protocol and system specific, see your local sytem documentation for details. The option is returned as a String with the data being the binary value of the socket option. - !ruby/struct:SM::Flow::H level: 3 text: Parameters - !ruby/object:SM::Flow::LIST contents: - !ruby/struct:SM::Flow::LI label: "*" body: <tt>level</tt> is an integer, usually one of the SOL_ constants such as Socket::SOL_SOCKET, or a protocol level. - !ruby/struct:SM::Flow::LI label: "*" body: <tt>optname</tt> is an integer, usually one of the SO_ constants, such as Socket::SO_REUSEADDR. type: :BULLET - !ruby/struct:SM::Flow::H level: 3 text: Examples - !ruby/struct:SM::Flow::P body: "Some socket options are integers with boolean values, in this case #getsockopt could be called like this:" - !ruby/struct:SM::Flow::VERB body: " optval = sock.getsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR)\n optval = optval.unpack "i"\n reuseaddr = optval[0] == 0 ? false : true\n" - !ruby/struct:SM::Flow::P body: "Some socket options are integers with numeric values, in this case #getsockopt could be called like this:" - !ruby/struct:SM::Flow::VERB body: " optval = sock.getsockopt(Socket::IPPROTO_IP, Socket::IP_TTL)\n ipttl = optval.unpack("i")[0]\n" - !ruby/struct:SM::Flow::P body: "Option values may be structs. Decoding them can be complex as it involves examining your system headers to determine the correct definition. An example is a +struct linger+, which may be defined in your system headers as:" - !ruby/struct:SM::Flow::VERB body: " struct linger {\n int l_onoff;\n int l_linger;\n };\n" - !ruby/struct:SM::Flow::P body: "In this case #getsockopt could be called like this:" - !ruby/struct:SM::Flow::VERB body: " optval = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER)\n onoff, linger = optval.unpack "ii"\n" full_name: BasicSocket#getsockopt is_singleton: false name: getsockopt params: " getsockopt(level, optname)\n" visibility: public
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
cdesc-BasicSocket.yaml
1.76 KB
lrw-r--r--
2023-07-26 13:47:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
getsockopt-i.yaml
2.14 KB
lrw-r--r--
2023-07-26 13:47:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
recv_nonblock-i.yaml
1.89 KB
lrw-r--r--
2023-07-26 13:47:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
setsockopt-i.yaml
2.77 KB
lrw-r--r--
2023-07-26 13:47:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).