Sha256: db3442028dd5e2e3494465bffe39f3aca7e3e08e67151189e1c0349c9f4c3fbb

Contents?: true

Size: 1.39 KB

Versions: 16

Compression:

Stored size: 1.39 KB

Contents

module OverSIP::SIP

  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
      @parser = ::OverSIP::SIP::MessageParser.new
      @buffer = ::IO::Buffer.new
      @state = :init
      @cvars = {}

      # Set the socket sending error handling to report the error:
      # :ERRORHANDLING_KILL, :ERRORHANDLING_IGNORE, :ERRORHANDLING_REPORT
      self.send_error_handling = :ERRORHANDLING_REPORT
    end

    def receive_senderror error, data
      log_system_error "Socket sending error: #{error.inspect}, #{data.inspect}"
    end

    def transport
      self.class.transport
    end

    def open?
      ! error?
    end

    # close() method causes @local_closed = true.
    alias close close_connection_after_writing
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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