C# Класс Universe.ClientStack.UDPBase

Base UDP server
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
m_localBindAddress System.Net.IPAddress
m_udpPort int

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

Метод Описание
Initialize ( IPAddress bindAddress, int port ) : void

Default Initialization

Start ( int recvBufferSize, bool asyncPacketHandling ) : void

Start the UDP server

This method will attempt to set the SIO_UDP_CONNRESET flag on the socket to get newer versions of Windows to behave in a sane manner (not throwing an exception when the remote side resets the connection). This call is ignored on Mono where the flag is not necessary

Stop ( ) : void

Stops the UDP server

SyncSend ( UDPPacketBuffer buf ) : void

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

Метод Описание
PacketReceived ( UDPPacketBuffer buffer ) : void

This method is called when an incoming packet is received

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

Метод Описание
AsyncBeginReceive ( ) : void
AsyncEndReceive ( IAsyncResult iar ) : void

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

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

Default Initialization
public Initialize ( IPAddress bindAddress, int port ) : void
bindAddress System.Net.IPAddress Local IP address to bind the server to
port int Port to listening for incoming UDP packets on
Результат void

PacketReceived() защищенный абстрактный Метод

This method is called when an incoming packet is received
protected abstract PacketReceived ( UDPPacketBuffer buffer ) : void
buffer UDPPacketBuffer Incoming packet buffer
Результат void

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

Start the UDP server
This method will attempt to set the SIO_UDP_CONNRESET flag on the socket to get newer versions of Windows to behave in a sane manner (not throwing an exception when the remote side resets the connection). This call is ignored on Mono where the flag is not necessary
public Start ( int recvBufferSize, bool asyncPacketHandling ) : void
recvBufferSize int /// The size of the receive buffer for /// the UDP socket. This value is passed up to the operating system /// and used in the system networking stack. Use zero to leave this /// value as the default ///
asyncPacketHandling bool /// Set this to true to start /// receiving more packets while current packet handler callbacks are /// still running. Setting this to false will complete each packet /// callback before the next packet is processed ///
Результат void

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

Stops the UDP server
public Stop ( ) : void
Результат void

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

public SyncSend ( UDPPacketBuffer buf ) : void
buf UDPPacketBuffer
Результат void

Описание свойств

m_localBindAddress защищенное свойство

Local IP address to bind to in server mode
protected IPAddress,System.Net m_localBindAddress
Результат System.Net.IPAddress

m_udpPort защищенное свойство

UDP port to bind to in server mode
protected int m_udpPort
Результат int