Method | Description | |
---|---|---|
Dispose ( ) : void |
Disposes of the resources (other than memory) used by the Listener. Stops listening and disposes all the client objects. Once disposed, this object should not be used anymore. |
|
GetClientAt ( int Index ) : |
Returns the requested client from the client list. If the specified index is invalid, the GetClientAt method returns null. |
|
GetClientCount ( ) : int |
Returns the number of clients in the client list.
|
|
GetLocalExternalIP ( ) : |
Returns an external IP address of this computer, if present. If this computer does not have any configured IP address, this method returns the IP address 0.0.0.0. |
|
GetLocalInternalIP ( ) : |
Returns an internal IP address of this computer, if present. If this computer does not have any configured IP address, this method returns the IP address 0.0.0.0. |
|
Listener ( int Port, |
Initializes a new instance of the Listener class. For the security of your server, try to avoid to listen on every network card (IPAddress.Any). Listening on a local IP address is usually sufficient and much more secure. |
|
OnAccept ( IAsyncResult ar ) : void |
Called when there's an incoming client connection waiting to be accepted.
|
|
Start ( ) : void |
Starts listening on the selected IP address and port.
|
|
ToString ( ) : string |
Returns a string representation of this object.
|
Method | Description | |
---|---|---|
AddClient ( |
Adds the specified Client to the client list. A client will never be added twice to the list. |
|
IsLocalIP ( |
Checks whether the specified IP address is a local IP address or not.
|
|
IsRemoteIP ( |
Checks whether the specified IP address is a remote IP address or not.
|
|
RemoveClient ( |
Removes the specified Client from the client list.
|
|
Restart ( ) : void |
Restarts listening on the selected IP address and port. This method is automatically called when the listening port or the listening IP address are changed. |
protected AddClient ( |
||
client | The client to add to the client list. | |
return | void |
public GetClientAt ( int Index ) : |
||
Index | int | The index of the requested client. |
return |
public static GetLocalExternalIP ( ) : |
||
return |
public static GetLocalInternalIP ( ) : |
||
return |
protected static IsLocalIP ( |
||
IP | The IP address to check. | |
return | bool |
protected static IsRemoteIP ( |
||
IP | The IP address to check. | |
return | bool |
public Listener ( int Port, |
||
Port | int | The port to listen on. |
Address | The address to listen on. You can specify IPAddress.Any to listen on all installed network cards. | |
return | System |
public abstract OnAccept ( IAsyncResult ar ) : void | ||
ar | IAsyncResult | The result of the asynchronous operation. |
return | void |
protected RemoveClient ( |
||
client | The client to remove from the client list. | |
return | void |