TCPSocket represents a TCP/IP client socket.

A simple client may look like:

require 'socket'

s = 'localhost', 2000

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

s.close             # close socket when done
Class Methods

Lookups host information by hostname.

#=> ["localhost", ["hal"], 2, ""]

Opens a TCP connection to remote_host on remote_port. If local_host and local_port are specified, then those parameters are used on the local end to establish the connection.