C# Class Sharpex2D.Network.Protocols.Udp.UdpServer

Inheritance: IServer, IDisposable
Datei anzeigen Open project: ThuCommix/Sharpex2D

Public Methods

Method Description
Close ( ) : void

Closes the server.

Dispose ( ) : void

Disposes the object.

Send ( IBasePackage package ) : void

Sends a package to the given receivers.

Send ( IBasePackage package, IPAddress receiver ) : void

Sends a package to the given receivers.

Subscribe ( IPackageListener subscriber ) : void

Subscribes to a Client.

UdpServer ( ) : System

Initializes a new UdpServer class.

Unsubscribe ( IPackageListener unsubscriber ) : void

Unsubscribes from a Client.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes the object.

Private Methods

Method Description
BeginAcceptConnections ( ) : void

Accepts clients if available.

GetConnection ( IPAddress ipAddress ) : UdpConnection

Gets the UpdConnection by the specified IPAddress.

GetPackageSubscriber ( Type type ) : IEnumerable

Gets a list of all matching package listeners.

HandlePackage ( IBasePackage package ) : void

Handles the given package.

Idle ( ) : void

Idles the thread.

PingRequestLoop ( ) : void

Sending a ping request every 30 seconds to all clients.

SendNotificationPackage ( NotificationMode mode, IConnection connections ) : void

Sends a NotificationPackage to all clients.

SetLatency ( PingPackage pingPackage ) : void

Sets the latency of a connection.

_connectionManager_PingTimedOut ( object sender, IPAddress ipAddress ) : void

Called if a PingRequest timed out.

Method Details

Close() public method

Closes the server.
public Close ( ) : void
return void

Dispose() public method

Disposes the object.
public Dispose ( ) : void
return void

Dispose() protected method

Disposes the object.
protected Dispose ( bool disposing ) : void
disposing bool Indicates whether managed resources should be disposed.
return void

Send() public method

Sends a package to the given receivers.
public Send ( IBasePackage package ) : void
package IBasePackage The Package.
return void

Send() public method

Sends a package to the given receivers.
public Send ( IBasePackage package, IPAddress receiver ) : void
package IBasePackage The Package.
receiver System.Net.IPAddress The Receiver.
return void

Subscribe() public method

Subscribes to a Client.
public Subscribe ( IPackageListener subscriber ) : void
subscriber IPackageListener The Subscriber.
return void

UdpServer() public method

Initializes a new UdpServer class.
public UdpServer ( ) : System
return System

Unsubscribe() public method

Unsubscribes from a Client.
public Unsubscribe ( IPackageListener unsubscriber ) : void
unsubscriber IPackageListener The Unsubscriber.
return void