D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
TCPSocket
/
Filename :
new-c.ri
back
Copy
U:RDoc::AnyMethod[iI"new:ETI"TCPSocket::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"POpens a TCP connection to +remote_host+ on +remote_port+. If +local_host+ ;TI"Qand +local_port+ are specified, then those parameters are used on the local ;TI"%end to establish the connection.;To:RDoc::Markup::BlankLine o; ; [I"CStarting from Ruby 3.4, this method operates according to the ;TI"ZHappy Eyeballs Version 2 ({RFC 8305}[https://datatracker.ietf.org/doc/html/rfc8305]) ;TI"-algorithm by default, except on Windows.;T@o; ; [I".For details on Happy Eyeballs Version 2, ;TI"Isee {Socket.tcp_fast_fallback=}[rdoc-ref:Socket.tcp_fast_fallback=].;T@o; ; [ I"<To make it behave the same as in Ruby 3.3 and earlier, ;TI"8explicitly specify the option fast_fallback:false. ;TI"=Or, setting Socket.tcp_fast_fallback=false will disable ;TI"SHappy Eyeballs Version 2 not only for this method but for all Socket globally.;T@o; ; [I"TWhen using TCPSocket.new on Windows, Happy Eyeballs Version 2 is not provided, ;TI"8and it behaves the same as in Ruby 3.3 and earlier.;T@o:RDoc::Markup::List: @type: LABEL:@items[o:RDoc::Markup::ListItem:@label[I":resolv_timeout;T; [o; ; [I"OSpecifies the timeout in seconds from when the hostname resolution starts.;To;;[I":connect_timeout;T; [o; ; [I"�This method sequentially attempts connecting to all candidate destination addresses.<br>The +connect_timeout+ specifies the timeout in seconds from the start of the connection attempt to the last candidate.<br>By default, all connection attempts continue until the timeout occurs.<br>When +fast_fallback:false+ is explicitly specified,<br>a timeout is set for each connection attempt and any connection attempt that exceeds its timeout will be canceled.;To;;[I":fast_fallback;T; [o; ; [I"IEnables the Happy Eyeballs Version 2 algorithm (enabled by default).;T: @fileI"ext/socket/tcpsocket.c;T:0@omit_headings_from_table_of_contents_below0I"�TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil, resolv_timeout: nil, connect_timeout: nil, fast_fallback: true) ;T0[ I"((p1, p2, p3 = v3, p4 = v4, p5 = {});T@;FI"TCPSocket;TcRDoc::NormalClass00