Class: RightSpeed::Handler::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Client

Returns a new instance of Client.



71
72
73
74
75
76
77
# File 'lib/right_speed/handler.rb', line 71

def initialize(conn)
  _, @port, _, @addr = conn.peeraddr
  _, @server_port, _, @server_addr = conn.addr
  if @server_addr == "::1"
    @server_addr = "localhost"
  end
end

Instance Attribute Details

#addrObject (readonly)

Returns the value of attribute addr.



69
70
71
# File 'lib/right_speed/handler.rb', line 69

def addr
  @addr
end

#portObject (readonly)

Returns the value of attribute port.



69
70
71
# File 'lib/right_speed/handler.rb', line 69

def port
  @port
end

#server_addrObject (readonly)

Returns the value of attribute server_addr.



69
70
71
# File 'lib/right_speed/handler.rb', line 69

def server_addr
  @server_addr
end

#server_portObject (readonly)

Returns the value of attribute server_port.



69
70
71
# File 'lib/right_speed/handler.rb', line 69

def server_port
  @server_port
end