C# Class Sharpex2D.Network.Protocols.Local.LocalServer

Inheritance: IServer
Datei anzeigen Open project: ThuCommix/Sharpex2D

Public Methods

Method Description
Close ( ) : void

Closes the server.

LocalServer ( ) : System

Initializes a new LocalServer class.

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.

Unsubscribe ( IPackageListener unsubscriber ) : void

Unsubscribes from a Client.

Private Methods

Method Description
BeginAcceptConnections ( ) : void

Accepts clients if available.

GetConnection ( IPAddress address ) : LocalConnection

Gets the connection.

GetPackageSubscriber ( Type type ) : IEnumerable

Gets a list of all matching package listeners.

HandleClient ( object objConnection ) : void

Handles a connection.

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.

SendTo ( IBasePackage package, IPAddress connection ) : void

Sends a package to a specified client.

SendToAllClients ( IBasePackage package ) : void

Sends a package to all clients.

SetLatency ( PingPackage pingPackage ) : void

Sets the latency of a connection.

Method Details

Close() public method

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

LocalServer() public method

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

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

Unsubscribe() public method

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