Method: TCPProxy#drop_all

Defined in:
lib/tcp_proxy.rb

#drop_allObject

Drops all established connections.



59
60
61
62
63
64
65
66
67
68
# File 'lib/tcp_proxy.rb', line 59

def drop_all
  # Copy the connections and then empty the collection
  connections = @connections_m.synchronize {
    @connections.tap { 
      @connections = [] } }
  
  connections.each do |conn|
    conn.close
  end
end