Class: UDPProxy::Clients
- Inherits:
-
Object
- Object
- UDPProxy::Clients
- Defined in:
- lib/udp_proxy/client.rb
Instance Method Summary collapse
- #client(ip, port) ⇒ Object
-
#initialize(server, address) ⇒ Clients
constructor
A new instance of Clients.
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 |