Class: TunnelClient::TunnelListener
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- TunnelClient::TunnelListener
- Defined in:
- lib/lds-cf-plugin/tunnel/tunnelclient.rb
Instance Attribute Summary collapse
-
#app_guid ⇒ Object
readonly
Returns the value of attribute app_guid.
-
#instance_id ⇒ Object
readonly
Returns the value of attribute instance_id.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#use_tls ⇒ Object
readonly
Returns the value of attribute use_tls.
Instance Method Summary collapse
-
#initialize(token, tunnel_server_host, tunnel_server_port, app_guid, instance_id, port, use_tls) ⇒ TunnelListener
constructor
A new instance of TunnelListener.
- #post_init ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(token, tunnel_server_host, tunnel_server_port, app_guid, instance_id, port, use_tls) ⇒ TunnelListener
Returns a new instance of TunnelListener.
24 25 26 27 28 29 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 24 def initialize(token, tunnel_server_host, tunnel_server_port, app_guid, instance_id, port, use_tls) @token, @app_guid, @instance_id, @port, @use_tls = token, app_guid, instance_id, port, use_tls @tunnel_server_host = tunnel_server_host @tunnel_server_port = tunnel_server_port end |
Instance Attribute Details
#app_guid ⇒ Object (readonly)
Returns the value of attribute app_guid.
19 20 21 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 19 def app_guid @app_guid end |
#instance_id ⇒ Object (readonly)
Returns the value of attribute instance_id.
20 21 22 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 20 def instance_id @instance_id end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
21 22 23 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 21 def port @port end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
18 19 20 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 18 def token @token end |
#use_tls ⇒ Object (readonly)
Returns the value of attribute use_tls.
22 23 24 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 22 def use_tls @use_tls end |
Instance Method Details
#post_init ⇒ Object
31 32 33 34 35 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 31 def post_init puts "Forwarding connection to server..." pause @connection = EventMachine.connect(@tunnel_server_host, @tunnel_server_port, TunnelConnection, self) end |
#unbind ⇒ Object
37 38 39 40 |
# File 'lib/lds-cf-plugin/tunnel/tunnelclient.rb', line 37 def unbind puts "Connection closed" @connection.close_connection_after_writing end |