Sha256: 6ec7e2fe62081c4798987940a85b14fc90335247b0386c27cd840057eee96fbf

Contents?: true

Size: 1.17 KB

Versions: 18

Compression:

Stored size: 1.17 KB

Contents

module OverSIP::WebSocket

  class Connection < ::EM::Connection

    include ::OverSIP::Logger
    include ::OverSIP::SIP::MessageProcessor

    class << self
      attr_accessor :ip_type, :ip, :port, :transport,
                    :via_core,
                    :record_route,
                    :outbound_record_route_fragment, :outbound_path_fragment,
                    :connections,
                    :invite_server_transactions, :non_invite_server_transactions,
                    :invite_client_transactions, :non_invite_client_transactions

      def reliable_transport_listener?
        @is_reliable_transport_listener
      end

      def outbound_listener?
        @is_outbound_listener
      end
    end


    attr_reader :cvars

    def initialize
      @buffer = ::IO::Buffer.new
      @state = :init
      @cvars = {}
    end

    def open?
      ! error?
    end

    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
  end

end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
oversip_p-1.0.2 lib/oversip/websocket/listeners/connection.rb
oversip_p-1.0.0 lib/oversip/websocket/listeners/connection.rb
oversip-2.0.4 lib/oversip/websocket/listeners/connection.rb
oversip-2.0.3 lib/oversip/websocket/listeners/connection.rb
oversip-2.0.2 lib/oversip/websocket/listeners/connection.rb
oversip-2.0.1 lib/oversip/websocket/listeners/connection.rb
oversip-2.0.0 lib/oversip/websocket/listeners/connection.rb
oversip-1.4.1 lib/oversip/websocket/listeners/connection.rb
oversip-1.4.0 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.8 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.7 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.6 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.5 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.3 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.2 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.1 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.0 lib/oversip/websocket/listeners/connection.rb
oversip-1.3.0.dev1 lib/oversip/websocket/listeners/connection.rb