gnufied / packet

Packet is a Library for Event Driven Network Programming in Ruby

This URL has Read+Write access

packet / bin / proxy_client.rb
100644 21 lines (16 sloc) 0.338 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class ProxyClient
  def recieve_data data
 
  end
 
  def connection_completed
    if @reconnect_timer
      cancel_timer(@reconnect_timer)
      @reconnect_timer = nil
    end
  end
 
  def unbind
    @reconnect_timer = add_timer(10) { attempt_reconnection }
  end
 
  def attempt_reconnection
    reconnect("localhost",port,self)
  end
end