Show / Hide Table of Contents

Class SIPStreamConnection

Represents a reliable stream connection (e.g. TCP or TLS) between two end points. Stream connections have a more overhead than UDP. The state of the connection has to be monitored and messages on the stream can be spread across multiple packets.

Inheritance
System.Object
SIPStreamConnection
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SIPSorcery.SIP
Assembly: SIPSorcery.dll
Syntax
public class SIPStreamConnection

Constructors

| Improve this Doc View Source

SIPStreamConnection(Socket, SIPEndPoint, SIPProtocolsEnum)

Declaration
public SIPStreamConnection(Socket streamSocket, SIPEndPoint remoteSIPEndPoint, SIPProtocolsEnum connectionProtocol)
Parameters
Type Name Description
System.Net.Sockets.Socket streamSocket
SIPEndPoint remoteSIPEndPoint
SIPProtocolsEnum connectionProtocol
| Improve this Doc View Source

SIPStreamConnection(Socket, Encoding, Encoding, SIPEndPoint, SIPProtocolsEnum)

Records the crucial stream connection properties and initialises the required buffers.

Declaration
public SIPStreamConnection(Socket streamSocket, Encoding sipEncoding, Encoding sipBodyEncoding, SIPEndPoint remoteSIPEndPoint, SIPProtocolsEnum connectionProtocol)
Parameters
Type Name Description
System.Net.Sockets.Socket streamSocket

The local socket the stream is using.

System.Text.Encoding sipEncoding
System.Text.Encoding sipBodyEncoding
SIPEndPoint remoteSIPEndPoint

The remote network end point of this connection.

SIPProtocolsEnum connectionProtocol

Whether the stream is TCP or TLS.

Fields

| Improve this Doc View Source

CONNECTION_ID_LENGTH

Declaration
public static int CONNECTION_ID_LENGTH
Field Value
Type Description
System.Int32
| Improve this Doc View Source

ConnectionProtocol

The connection protocol in use for this stream (TCP or TLS).

Declaration
public SIPProtocolsEnum ConnectionProtocol
Field Value
Type Description
SIPProtocolsEnum
| Improve this Doc View Source

LastTransmission

Records when a transmission was last sent or received on this stream.

Declaration
public DateTime LastTransmission
Field Value
Type Description
System.DateTime
| Improve this Doc View Source

MaxSIPTCPMessageSize

Declaration
public static int MaxSIPTCPMessageSize
Field Value
Type Description
System.Int32
| Improve this Doc View Source

RecvSocketArgs

Declaration
public SocketAsyncEventArgs RecvSocketArgs
Field Value
Type Description
System.Net.Sockets.SocketAsyncEventArgs
| Improve this Doc View Source

RemoteSIPEndPoint

The remote end point for the stream.

Declaration
public SIPEndPoint RemoteSIPEndPoint
Field Value
Type Description
SIPEndPoint
| Improve this Doc View Source

SslStream

For secure streams the TCP connection will be upgraded to an SSL stream and the SslStreamBuffer will be used for receives.

Declaration
public SIPStreamWrapper SslStream
Field Value
Type Description
SIPStreamWrapper
| Improve this Doc View Source

SslStreamBuffer

The receive buffer to use for SSL streams.

Declaration
public byte[] SslStreamBuffer
Field Value
Type Description
System.Byte[]
| Improve this Doc View Source

StreamSocket

The underlying TCP socket for the stream connection. To take advantage of newer async TCP IO operations the RecvSocketArgs is used for TCP channel receives.

Declaration
public Socket StreamSocket
Field Value
Type Description
System.Net.Sockets.Socket

Properties

| Improve this Doc View Source

ConnectionID

A unique ID for this connection. It will be recorded on any received messages to allow responses to quickly identify the same connection.

Declaration
public string ConnectionID { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RecvEndPosn

The current end position of unprocessed data in the receive buffer.

Declaration
public int RecvEndPosn { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

RecvStartPosn

The current start position of unprocessed data in the receive buffer.

Declaration
public int RecvStartPosn { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

ExtractSIPMessages(SIPChannel, Byte[], Int32)

Attempts to extract SIP messages from the data that has been received on the SIP stream connection.

Declaration
public void ExtractSIPMessages(SIPChannel recvChannel, byte[] buffer, int bytesRead)
Parameters
Type Name Description
SIPChannel recvChannel

The receiving SIP channel.

System.Byte[] buffer

The buffer holding the current data from the stream. Note that the buffer can stretch over multiple receives.

System.Int32 bytesRead

The bytes that were read by the latest receive operation (the new bytes available).

Events

| Improve this Doc View Source

SIPMessageReceived

Event for new SIP requests or responses becoming available.

Declaration
public event SIPMessageReceivedAsyncDelegate SIPMessageReceived
Event Type
Type Description
SIPMessageReceivedAsyncDelegate

Extension Methods

JSONWriter.ToJson(Object)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX