Class: LogSimulator::SocketConnetion

Inherits:
Object
  • Object
show all
Defined in:
lib/socket_connetion.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ SocketConnetion

Returns a new instance of SocketConnetion.



6
7
8
9
10
11
12
# File 'lib/socket_connetion.rb', line 6

def initialize (host,port)
  begin
    @socket = TCPSocket.new(host,port)
  rescue Exception => _
    @socket = nil
  end
end

Instance Attribute Details

#socketObject (readonly)

Returns the value of attribute socket.



5
6
7
# File 'lib/socket_connetion.rb', line 5

def socket
  @socket
end