public class WebsocketTools
{
//The websocket URL
string url;
//Where you want to fetch from the websocket, not used in Send()
public enum Fetch
{
OnUpdate,
OnFixedUpdate,
OnStart,
}
//An action called when a message is recived from the websocket
public delegate void OnMessageReceived( string message );
//A game resource that holds Json or string data to be send to the Websocket
public WebsocketMessage message;
}
public class WebSocketUtility
{
//Sends a message over a websocket connection
public static async Task SendAsync( WebsocketTools websocketTools );
//Sends a string over a websocket connection
public static async Task SendStringAsync( string url, string message )
}