Returns the Object#object_id
of the internal object.
Extracts addr from IPV6_PKTINFO ancillary data.
IPV6_PKTINFO is defined by RFC 3542.
addr = Addrinfo.ip("::1") ifindex = 0 ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex) p ancdata.ipv6_pktinfo_addr #=> #<Addrinfo: ::1>
Extracts ifindex from IPV6_PKTINFO ancillary data.
IPV6_PKTINFO is defined by RFC 3542.
addr = Addrinfo.ip("::1") ifindex = 0 ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex) p ancdata.ipv6_pktinfo_ifindex #=> 0
Creates a new Socket::Option
object for IP_MULTICAST_TTL.
The size is dependent on the platform.
p Socket::Option.ipv4_multicast_ttl(10) #=> #<Socket::Option: INET IP MULTICAST_TTL 10>
Returns the ipv4_multicast_ttl
data in sockopt as an integer.
sockopt = Socket::Option.ipv4_multicast_ttl(10) p sockopt.ipv4_multicast_ttl => 10
Load an iseq object from binary format String
object created by RubyVM::InstructionSequence.to_binary
.
This loader does not have a verifier, so that loading broken/modified binary causes critical problem.
You should not load binary data provided by others. You should use binary data translated by yourself.
Creates a regular expression to match IPv4 addresses
Set
the default value for the :argc_limit option.
See new(). The initial default value is 256.
Set
the default value for the :id_conv option.
See new(). The initial default value is a DRbIdConv
instance.
Check that a method is callable via dRuby.
obj
is the object we want to invoke the method on. msg_id
is the method name, as a Symbol
.
If the method is an insecure method (see insecure_method?
) a SecurityError
is thrown. If the method is private or undefined, a NameError
is thrown.
WARNING This method opens a serious security hole. Never use this method in production code.
Sets the output stream for debugging:
http = Net::HTTP.new(hostname) File.open('t.tmp', 'w') do |file| http.set_debug_output(file) http.start http.get('/nosuch/1') http.finish end puts File.read('t.tmp')
Output:
opening connection to jsonplaceholder.typicode.com:80... opened <- "GET /nosuch/1 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: jsonplaceholder.typicode.com\r\n\r\n" -> "HTTP/1.1 404 Not Found\r\n" -> "Date: Mon, 12 Dec 2022 21:14:11 GMT\r\n" -> "Content-Type: application/json; charset=utf-8\r\n" -> "Content-Length: 2\r\n" -> "Connection: keep-alive\r\n" -> "X-Powered-By: Express\r\n" -> "X-Ratelimit-Limit: 1000\r\n" -> "X-Ratelimit-Remaining: 999\r\n" -> "X-Ratelimit-Reset: 1670879660\r\n" -> "Vary: Origin, Accept-Encoding\r\n" -> "Access-Control-Allow-Credentials: true\r\n" -> "Cache-Control: max-age=43200\r\n" -> "Pragma: no-cache\r\n" -> "Expires: -1\r\n" -> "X-Content-Type-Options: nosniff\r\n" -> "Etag: W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"\r\n" -> "Via: 1.1 vegur\r\n" -> "CF-Cache-Status: MISS\r\n" -> "Server-Timing: cf-q-config;dur=1.3000000762986e-05\r\n" -> "Report-To: {\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=yOr40jo%2BwS1KHzhTlVpl54beJ5Wx2FcG4gGV0XVrh3X9OlR5q4drUn2dkt5DGO4GDcE%2BVXT7CNgJvGs%2BZleIyMu8CLieFiDIvOviOY3EhHg94m0ZNZgrEdpKD0S85S507l1vsEwEHkoTm%2Ff19SiO\"}],\"group\":\"cf-nel\",\"max_age\":604800}\r\n" -> "NEL: {\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}\r\n" -> "Server: cloudflare\r\n" -> "CF-RAY: 778977dc484ce591-DFW\r\n" -> "alt-svc: h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400\r\n" -> "\r\n" reading 2 bytes... -> "{}" read 2 bytes Conn keep-alive