| Server IP : 162.214.74.102 / Your IP : 216.73.217.21 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Socket/ |
Upload File : |
U:RDoc::AnyMethod[iI"tcp_server_sockets:EFI"Socket::tcp_server_sockets;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I":creates TCP/IP server sockets for _host_ and _port_. ;TI"_host_ is optional.;To:RDoc::Markup::BlankLine o;
; [I"If no block given, ;TI".it returns an array of listening sockets.;T@o;
; [I"@If a block is given, the block is called with the sockets. ;TI")The value of the block is returned. ;TI"3The socket is closed when this method returns.;T@o;
; [I"?If _port_ is 0, actual port number is chosen dynamically. ;TI"<However all sockets in the result has same port number.;T@o:RDoc::Markup::Verbatim; [I"/# tcp_server_sockets returns two sockets.
;TI"/sockets = Socket.tcp_server_sockets(1296)
;TI"4p sockets #=> [#<Socket:fd 3>, #<Socket:fd 4>]
;TI"
;TI"3# The sockets contains IPv6 and IPv4 sockets.
;TI"+sockets.each {|s| p s.local_address }
;TI"$#=> #<Addrinfo: [::]:1296 TCP>
;TI"'# #<Addrinfo: 0.0.0.0:1296 TCP>
;TI"
;TI"[# IPv6 and IPv4 socket has same port number, 53114, even if it is chosen dynamically.
;TI",sockets = Socket.tcp_server_sockets(0)
;TI"+sockets.each {|s| p s.local_address }
;TI"%#=> #<Addrinfo: [::]:53114 TCP>
;TI"(# #<Addrinfo: 0.0.0.0:53114 TCP>
;TI"
;TI"-# The block is called with the sockets.
;TI"-Socket.tcp_server_sockets(0) {|sockets|
;TI"6 p sockets #=> [#<Socket:fd 3>, #<Socket:fd 4>]
;TI"};T:@format0:
@fileI"ext/socket/lib/socket.rb;T:0@omit_headings_from_table_of_contents_below00I"sockets;T[ I"(host=nil, port);T@2FI"Socket;TcRDoc::NormalClass00