C# Class PiE.Net.UDPSocket

UDP socket abstraction.
Mostra file Open project: pioneers/forseti Class Usage Examples

Public Methods

Method Description
AddDataReceiver ( UDPSocketDataCallback cb ) : void

Adds the data receiver, to be notified on data receive. Notified at this.notifyReceive().

Poll ( ) : void
RemoveDataReceiver ( UDPSocketDataCallback cb ) : void

Removes the data receiver, to from being notified on data receive.

Run ( ) : void

Run this instance.

Send ( byte byteData, string address ) : void
Start ( ) : void

Start this instance.

UDPSocket ( int listenPort, int sendPort ) : System

Initializes a new instance of the PiE.Net.UDPSocket class.

Private Methods

Method Description
NotifyReceive ( byte received, string senderAddress ) : void

Notifies listeners that a SocketServerConnection has received data. Called by ServerSocketConnections which are children of this SocketServer.

ReadCallback ( IAsyncResult ar ) : void

Reads the callback.

ReadCallbackBlocking ( byte received, IPAddress address ) : void

Method Details

AddDataReceiver() public method

Adds the data receiver, to be notified on data receive. Notified at this.notifyReceive().
public AddDataReceiver ( UDPSocketDataCallback cb ) : void
cb UDPSocketDataCallback /// The callback to call on data receive. ///
return void

Poll() public method

public Poll ( ) : void
return void

RemoveDataReceiver() public method

Removes the data receiver, to from being notified on data receive.
public RemoveDataReceiver ( UDPSocketDataCallback cb ) : void
cb UDPSocketDataCallback /// The callback to call on data receive, that was registered with this.AddDataReciever(). ///
return void

Run() public method

Run this instance.
public Run ( ) : void
return void

Send() public method

public Send ( byte byteData, string address ) : void
byteData byte
address string
return void

Start() public method

Start this instance.
public Start ( ) : void
return void

UDPSocket() public method

Initializes a new instance of the PiE.Net.UDPSocket class.
public UDPSocket ( int listenPort, int sendPort ) : System
listenPort int
sendPort int
return System