C# Class SipSharp.Transports.TcpTransport

Transports messages over TCP.
This transport takes care of ALL sockets for TCP.
Inheritance: ITransport
Afficher le fichier Open project: jgauffin/SipSharp Class Usage Examples

Méthodes publiques

Méthode Description
Send ( EndPoint endPoint, byte buffer, int offset, int count ) : void

Send a buffer to a certain end point.

Start ( ) : void

Starts the specified end point.

TcpTransport ( IPEndPoint endPoint, MessageFactory factory ) : System

Initializes a new instance of the TcpTransport class.

Méthodes protégées

Méthode Description
CreateAndConnect ( IPEndPoint endPoint ) : ClientContext

Create a new socket and try to connect to a remote client/server.

SetupNewContext ( Socket socket ) : void

Create a new context and allocate it's buffer.

Private Methods

Méthode Description
HandleDisconnect ( ClientContext context ) : void
OnAccept ( IAsyncResult ar ) : void
OnReceive ( IAsyncResult ar ) : void
OnSend ( IAsyncResult ar ) : void

Method Details

CreateAndConnect() protected méthode

Create a new socket and try to connect to a remote client/server.
If connection fails.
protected CreateAndConnect ( IPEndPoint endPoint ) : ClientContext
endPoint System.Net.IPEndPoint Endpoint that should get connected.
Résultat ClientContext

Send() public méthode

Send a buffer to a certain end point.
is not of the type expected by the transport implementation endPoint is null. offset+count is out of range.
public Send ( EndPoint endPoint, byte buffer, int offset, int count ) : void
endPoint System.Net.EndPoint End point that the buffer should be sent to.
buffer byte buffer to send.
offset int Position of first byte to send.
count int Number of bytes, from offset, to send.
Résultat void

SetupNewContext() protected méthode

Create a new context and allocate it's buffer.
Could not allocate new buffer. Could not read from socket. Socket have been disposed.
protected SetupNewContext ( Socket socket ) : void
socket Socket The socket.
Résultat void

Start() public méthode

Starts the specified end point.
is not of the type expected by the transport implementation endPoint is null. If listener cannot be started.
public Start ( ) : void
Résultat void

TcpTransport() public méthode

Initializes a new instance of the TcpTransport class.
public TcpTransport ( IPEndPoint endPoint, MessageFactory factory ) : System
endPoint System.Net.IPEndPoint End point to accept new connections on.
factory SipSharp.Messages.MessageFactory Message factory.
Résultat System