C# Класс SipSharp.Transports.TcpTransport

Transports messages over TCP.
This transport takes care of ALL sockets for TCP.
Наследование: ITransport
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
HandleDisconnect ( ClientContext context ) : void
OnAccept ( IAsyncResult ar ) : void
OnReceive ( IAsyncResult ar ) : void
OnSend ( IAsyncResult ar ) : void

Описание методов

CreateAndConnect() защищенный Метод

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.
Результат ClientContext

Send() публичный Метод

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.
Результат void

SetupNewContext() защищенный Метод

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.
Результат void

Start() публичный Метод

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
Результат void

TcpTransport() публичный Метод

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.
Результат System