Client :: killClient - Kill client on the server
The function can be called in order to cancel one or more clients currently running on the server. When calling the function for a client handle referring to a local connection, the function terminates normally but has no effect.
Implementation overview
- Kill all clients
Client :: killClient ( iWait, bSendMessage ) - Kill single client
Client :: killClient ( iClientId, iWait, bSendMessage )
Implementation details
-
Kill all clients
Client  :: killClient ( int32 iWait, bool bSendMessage )
The function will kill all clients. After calling the function, no more clients can be started on the server.
In order to send a warning message to the clients before killing, true should be passed in bSendMessage . This will cause problems, when one or more clients are dead clients, which are not able to receive messages anymore.
Before killing clients, the function sends a message to all running clients and waits the number of seconds passed in iWait (kill time). In order to kill dead clients, 0 should be passed in iWait .
When the client handle is not valid, the function throws an exception.
- iWait
- Number of seconds to wait
The system waits the given number of seconds before executing the request.
- bSendMessage
- Send message to clients going to be killed
The option must be set to true in order to sent a message to the clients going to be killed. Otherwise ( false ) clients are killed without warning.
to list
- iWait
- Number of seconds to wait
-
Kill single client
Client  :: killClient ( int32 iClientId, int32 iWait, bool bSendMessage )
The function can be called in order to cancel the client with the identification passed in iClientID . The iClientID is the connection identifier returned from the server to the client after connecting ( connectionID() property) The number for the clients are shown in the ShowClients command.
In order to send a warning message to the client before killing, true should be passed in bSendMessage . This cannot work, when going to kill a dead client, which is not able to receive messages anymore.
Before killing the client, the function waits the number of seconds passed in iWait . In order to kill dead clients, 0 should be passed in iWait .
When the client handle is not valid or when passing an invalid client number, the function throws an exception.
- iClientId
- Client session number
The client number is an internal number the server has assigned to the client while connecting. You can retrieve client numbers by using the GetClientHandle () function which returns client information for all active clients.
- iWait
- Number of seconds to wait
The system waits the given number of seconds before executing the request.
- bSendMessage
- Send message to clients going to be killed
The option must be set to true in order to sent a message to the clients going to be killed. Otherwise ( false ) clients are killed without warning.
to list
- iClientId
- Client session number