C# Класс NewTOAPIA.Net.UdpReceiver

Наследование: IReceiveBufferChunk, IDisposable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AsyncReceiveFrom ( Queue queueOfBufferChunks, ReceivedFromCallback callback ) : void
Dispose ( ) : void

Dispose per the IDisposable pattern

Receive ( BufferChunk packetBuffer ) : void

Receive a packet into a BufferChunk. This method is preferred over receiving into a byte[] because you can allocate a large byte[] in one BufferChunk and continously receive into the buffer without recreating byte[]s and dealing with the memory allocation overhead that causes. The number of bytes received is stored in BufferChunk.Length.

ReceiveFrom ( BufferChunk packetBuffer, EndPoint &endPoint ) : void

Same as Receive, but you also get an EndPoint containing the sender of the packet.

UdpReceiver ( IPEndPoint endPoint, int timeoutMilliseconds ) : System

Constructor that binds this object instance to an IPEndPoint. If you need to change IPEndPoint dynamically, Dispose and recreate a new object.

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

Метод Описание
asyncReceiveCallback ( IAsyncResult ar ) : void

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

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

public AsyncReceiveFrom ( Queue queueOfBufferChunks, ReceivedFromCallback callback ) : void
queueOfBufferChunks Queue
callback ReceivedFromCallback
Результат void

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

Dispose per the IDisposable pattern
public Dispose ( ) : void
Результат void

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

Receive a packet into a BufferChunk. This method is preferred over receiving into a byte[] because you can allocate a large byte[] in one BufferChunk and continously receive into the buffer without recreating byte[]s and dealing with the memory allocation overhead that causes. The number of bytes received is stored in BufferChunk.Length.
public Receive ( BufferChunk packetBuffer ) : void
packetBuffer BufferChunk BufferChunk
Результат void

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

Same as Receive, but you also get an EndPoint containing the sender of the packet.
public ReceiveFrom ( BufferChunk packetBuffer, EndPoint &endPoint ) : void
packetBuffer BufferChunk BufferChunk
endPoint System.Net.EndPoint EndPoint
Результат void

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

Constructor that binds this object instance to an IPEndPoint. If you need to change IPEndPoint dynamically, Dispose and recreate a new object.
public UdpReceiver ( IPEndPoint endPoint, int timeoutMilliseconds ) : System
endPoint System.Net.IPEndPoint IPEndPoint where we should be listening for IP Multicast packets.
timeoutMilliseconds int
Результат System