U:RDoc::AnyMethod[iI"tcp:EFI"Socket::tcp;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Ecreates a new socket object connected to host:port using TCP/IP.;To:RDoc::Markup::BlankLineo; ; [I"(If local_host:local_port is given, ;TI"the socket is bound to it.;T@o; ; [I"IThe optional last argument _opts_ is options represented by a hash. ;TI"'_opts_ may have following options:;T@o:RDoc::Markup::List: @type: LABEL: @items[o:RDoc::Markup::ListItem: @label[I":connect_timeout;T; [o; ; [I"$specify the timeout in seconds.;T@o; ; [I"?If a block is given, the block is called with the socket. ;TI")The value of the block is returned. ;TI"3The socket is closed when this method returns.;T@o; ; [I"2If no block is given, the socket is returned.;T@o:RDoc::Markup::Verbatim; [ I"1Socket.tcp("www.ruby-lang.org", 80) {|sock| ;TI"F sock.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n" ;TI" sock.close_write ;TI" puts sock.read ;TI"};T: @format0: @fileI"ext/socket/lib/socket.rb;T:0@omit_headings_from_table_of_contents_below0I"ŽSocket.tcp(host, port, local_host=nil, local_port=nil, [opts]) {|socket| ... } Socket.tcp(host, port, local_host=nil, local_port=nil, [opts]) ;TI" socket;F[I"K(host, port, local_host = nil, local_port = nil, connect_timeout: nil);T@/FI" Socket;TcRDoc::NormalClass00