socket.connect(remote_sockaddr) => 0
Instance Public methods
Requests a connection to be made on the given remote_sockaddr.
Returns 0 if successful, otherwise an exception is raised.
Parameter
remote_sockaddr - the struct sockaddr contained
in a string or Addrinfo object
Example:
# Pull down Google's web page
require 'socket'
include Socket::Constants
socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
sockaddr = Socket.pack_sockaddr_in( 80, 'www.google.com' )
socket.connect( soc