WebsocketCustomServerBroadcast

Broadcast a message to a custom WebSocket server

Signature

public void WebsocketCustomServerBroadcast(string data, string sessionId, int connection = 0)

Parameters

data
string required

Data to be sent to connected clients

JSON must be stringified.

sessionId
string required

No description provided.

connection
int
Default:
0

No description provided.

Return Type

void

Example

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

        //Send data "Kachow" to specific session via specific websocket server
        //Index is from top to bottom of the clients list, starting at 0
        CPH.WebsocketCustomServerBroadcast(data, sessionId, 0); 
        return true;
    }
}