socket.accept => [client_socket, client_addrinfo]
Instance Public methods
Accepts a next connection. Returns a new Socket object and Addrinfo object.
serv = Socket.new(:INET, :STREAM, 0) serv.listen(5) c = Socket.new(:INET, :STREAM, 0) c.connect(serv.connect_address) p serv.accept #=> [#<Socket:fd 6>, #<Addrinfo: 127.0.0.1:48555 TCP>]
Please login to continue.