C# Class SipSharp.Transports.TransportLayer

Responsible of transporting messages to/from end points.

The transport manager inspects messages to be able to determine where they should be send. It will then serialize the message and send it using the appropiate protocol. It will automatically create a new socket if no socket exists to the destination.

The manager will switch protocol from UDP to TCP if the max UDP packet size is exceeded.

Incoming messages are handled by the MessageFactory. Hook its events to be able to handle them.

Inheritance: ITransportLayer
Datei anzeigen Open project: jgauffin/SipSharp Class Usage Examples

Public Methods

Method Description
Register ( ITransport transport ) : void

Register a new transport implementation.

Send ( IRequest request ) : void
Send ( IResponse response ) : void
Start ( ) : void

Start layer.

TransportLayer ( MessageFactory messageFactory ) : System

Initializes a new instance of the TransportLayer class.

Protected Methods

Method Description
CreateEndPoint ( IRequest request ) : EndPoint

Create a endpoint for the destination that should be reached.

Private Methods

Method Description
GetMessage ( IRequest request ) : string
GetMessage ( IResponse response ) : string
OnRequest ( object sender, RequestEventArgs e ) : void
OnResponse ( object sender, ResponseEventArgs e ) : void

Method Details

CreateEndPoint() protected method

Create a endpoint for the destination that should be reached.
protected CreateEndPoint ( IRequest request ) : EndPoint
request IRequest Request to send
return System.Net.EndPoint

Register() public method

Register a new transport implementation.
Server have already been started.
public Register ( ITransport transport ) : void
transport ITransport
return void

Send() public method

public Send ( IRequest request ) : void
request IRequest
return void

Send() public method

public Send ( IResponse response ) : void
response IResponse
return void

Start() public method

Start layer.
public Start ( ) : void
return void

TransportLayer() public method

Initializes a new instance of the TransportLayer class.
public TransportLayer ( MessageFactory messageFactory ) : System
messageFactory SipSharp.Messages.MessageFactory
return System