WebsocketCustomServerCloseAllSessions

Disconnect all client sessions from a custom WebSocket server

Signature

public void WebsocketCustomServerCloseAllSessions(int connection = 0)

Parameters

connection
int
Default:
0

The index of the WebSocket Server

Zero-indexed based on the order you see in Servers/Clients > WebSocket Servers
e.g. The first server in the list is 0, the second server in the list is 1, and so on...

Return Type

void

Example

using System;
public class CPHInline
{
    public bool Execute()
    {
        //Define session Id
        string sessionId = "JdHd4aVd";

        //Close all sessions of custom websocket server index 0
        //Index is from top to bottom of the clients list, starting at 0
        CPH.WebsocketCustomServerCloseAllSessions(0); 
        return true;
    }
}