Class: Thin::Glazed::HttpGlazing

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/thin/glazed/http_glazing.rb

Direct Known Subclasses

HttpsGlazing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_port) ⇒ HttpGlazing

Returns a new instance of HttpGlazing.



4
5
6
# File 'lib/thin/glazed/http_glazing.rb', line 4

def initialize(client_port)
  @client_port = client_port
end

Instance Attribute Details

#client_portObject (readonly)

Returns the value of attribute client_port.



2
3
4
# File 'lib/thin/glazed/http_glazing.rb', line 2

def client_port
  @client_port
end

Instance Method Details

#receive_data(data) ⇒ Object



8
9
10
# File 'lib/thin/glazed/http_glazing.rb', line 8

def receive_data(data)
  client.send_data data unless data.nil?
end

#relay_from_client(data) ⇒ Object



12
13
14
# File 'lib/thin/glazed/http_glazing.rb', line 12

def relay_from_client(data)
  send_data data unless data.nil?
end

#unbindObject



16
17
18
19
# File 'lib/thin/glazed/http_glazing.rb', line 16

def unbind
  client.close_connection
  @client = nil
end

#unbind_clientObject



21
22
23
24
# File 'lib/thin/glazed/http_glazing.rb', line 21

def unbind_client
  close_connection_after_writing
  @client = nil
end