Class: UDPProxy::Clients

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

Instance Method Summary collapse

Constructor Details

#initialize(server, address) ⇒ Clients

Returns a new instance of Clients.



18
19
20
21
22
# File 'lib/udp_proxy/client.rb', line 18

def initialize(server, address)
  @address = address
  @clients = {}
  @server = server
end

Instance Method Details

#client(ip, port) ⇒ Object



24
25
26
# File 'lib/udp_proxy/client.rb', line 24

def client(ip, port)
  @clients[key(ip, port)] || @clients[key(ip,port)] = create_client(ip, port)
end