Class: OverSIP::WebSocket::Connection
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- OverSIP::WebSocket::Connection
- Includes:
- Logger, SIP::MessageProcessor
- Defined in:
- lib/oversip/websocket/listeners/connection.rb
Direct Known Subclasses
Constant Summary
Constants included from SIP::MessageProcessor
SIP::MessageProcessor::MSG_TYPE
Class Attribute Summary collapse
-
.connections ⇒ Object
Returns the value of attribute connections.
-
.invite_client_transactions ⇒ Object
Returns the value of attribute invite_client_transactions.
-
.invite_server_transactions ⇒ Object
Returns the value of attribute invite_server_transactions.
-
.ip ⇒ Object
Returns the value of attribute ip.
-
.ip_type ⇒ Object
Returns the value of attribute ip_type.
-
.non_invite_client_transactions ⇒ Object
Returns the value of attribute non_invite_client_transactions.
-
.non_invite_server_transactions ⇒ Object
Returns the value of attribute non_invite_server_transactions.
-
.outbound_path_fragment ⇒ Object
Returns the value of attribute outbound_path_fragment.
-
.outbound_record_route_fragment ⇒ Object
Returns the value of attribute outbound_record_route_fragment.
-
.port ⇒ Object
Returns the value of attribute port.
-
.record_route ⇒ Object
Returns the value of attribute record_route.
-
.transport ⇒ Object
Returns the value of attribute transport.
-
.via_core ⇒ Object
Returns the value of attribute via_core.
Instance Attribute Summary collapse
-
#cvars ⇒ Object
readonly
Returns the value of attribute cvars.
Class Method Summary collapse
Instance Method Summary collapse
- #close(status = nil, reason = nil) ⇒ Object
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
- #open? ⇒ Boolean
Methods included from Logger
close, fg_system_msg2str, init_logger_mq, load_methods, #log_id, syslog_system_msg2str, syslog_user_msg2str
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
29 30 31 32 33 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 29 def initialize @buffer = ::IO::Buffer.new @state = :init @cvars = {} end |
Class Attribute Details
.connections ⇒ Object
Returns the value of attribute connections.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def connections @connections end |
.invite_client_transactions ⇒ Object
Returns the value of attribute invite_client_transactions.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def invite_client_transactions @invite_client_transactions end |
.invite_server_transactions ⇒ Object
Returns the value of attribute invite_server_transactions.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def invite_server_transactions @invite_server_transactions end |
.ip ⇒ Object
Returns the value of attribute ip.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def ip @ip end |
.ip_type ⇒ Object
Returns the value of attribute ip_type.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def ip_type @ip_type end |
.non_invite_client_transactions ⇒ Object
Returns the value of attribute non_invite_client_transactions.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def non_invite_client_transactions @non_invite_client_transactions end |
.non_invite_server_transactions ⇒ Object
Returns the value of attribute non_invite_server_transactions.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def non_invite_server_transactions @non_invite_server_transactions end |
.outbound_path_fragment ⇒ Object
Returns the value of attribute outbound_path_fragment.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def outbound_path_fragment @outbound_path_fragment end |
.outbound_record_route_fragment ⇒ Object
Returns the value of attribute outbound_record_route_fragment.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def outbound_record_route_fragment @outbound_record_route_fragment end |
.port ⇒ Object
Returns the value of attribute port.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def port @port end |
.record_route ⇒ Object
Returns the value of attribute record_route.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def record_route @record_route end |
.transport ⇒ Object
Returns the value of attribute transport.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def transport @transport end |
.via_core ⇒ Object
Returns the value of attribute via_core.
9 10 11 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 9 def via_core @via_core end |
Instance Attribute Details
#cvars ⇒ Object (readonly)
Returns the value of attribute cvars.
27 28 29 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 27 def cvars @cvars end |
Class Method Details
.outbound_listener? ⇒ Boolean
21 22 23 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 21 def outbound_listener? @is_outbound_listener end |
.reliable_transport_listener? ⇒ Boolean
17 18 19 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 17 def reliable_transport_listener? @is_reliable_transport_listener end |
Instance Method Details
#close(status = nil, reason = nil) ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 39 def close status=nil, reason=nil # When in WebSocket protocol send a close control frame before closing # the connection. if @state == :websocket @ws_framing.send_close_frame status, reason end close_connection_after_writing @state = :ignore end |
#open? ⇒ Boolean
35 36 37 |
# File 'lib/oversip/websocket/listeners/connection.rb', line 35 def open? ! error? end |