Class: EventMachine::Protocols::ServerConnection

Inherits:
Connection
  • Object
show all
Defined in:
lib/proxymachine/server_connection.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ ServerConnection

Returns a new instance of ServerConnection.



8
9
10
# File 'lib/proxymachine/server_connection.rb', line 8

def initialize(conn)
  @client_side = conn
end

Class Method Details

.request(host, port, client_side) ⇒ Object



4
5
6
# File 'lib/proxymachine/server_connection.rb', line 4

def self.request(host, port, client_side)
  EventMachine.connect(host, port, self, client_side)
end

Instance Method Details

#post_initObject



12
13
14
# File 'lib/proxymachine/server_connection.rb', line 12

def post_init
  proxy_incoming_to @client_side
end

#unbindObject



16
17
18
# File 'lib/proxymachine/server_connection.rb', line 16

def unbind
  @client_side.close_connection_after_writing
end