Type:
Class

TCPSocket represents a TCP/IP client socket.

A simple client may look like:

require 'socket'

s = TCPSocket.new 'localhost', 2000

while line = s.gets # Read lines from socket
  puts line         # and print them
end

s.close             # close socket when done
gethostbyname

TCPSocket.gethostbyname(hostname) => [official_hostname, alias_hostnames, address_family, *address_list] Class

2015-05-17 07:10:03
new

TCPSocket.new(remote_host, remote_port, local_host=nil, local_port=nil) Class Public methods

2015-05-17 07:15:37
new 2

new(host, serv, *rest) Class Public methods

2015-05-17 07:16:56