Class: Stomper::Sockets::TCP

Inherits:
TCPSocket
  • Object
show all
Defined in:
lib/stomper/sockets.rb

Overview

A wrapper for an TCP Socket that tidies up the specifics so our Connection library isn’t troubled by them.

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ TCP

Create a new Stomper::Sockets::TCP connection to host on port.

Parameters:

  • host (String)

    hostname or IP address to connect to

  • port (Fixnum)

    port number to establish the connection on



70
71
72
73
# File 'lib/stomper/sockets.rb', line 70

def initialize(host, port)
  @socket = TCPSocket.new(host, port)
  super(@socket)
end