Skip to content

Quick Edit to Home Page Website #104

@brennick

Description

@brennick

Currently, you have this as your client example code:

//...refs
using Alchemy;
using Alchemy.Classes;

static void Main(string[] args)
{
  var aClient = new WebSocketClient("ws://alchemywebsockets.net:81/chat"){
    OnReceive = OnReceive,
    OnSend = OnSend,
    OnConnect = OnConnected,
    OnConnected = OnConnect,
    OnDisconnect = OnDisconnect
  });

  aClient.Connect();
  aClient.Send("Hey!"); // string or byte[]
  aClient.Disconnect();
}

static void OnReceive(UserContext context)
{
  Console.WriteLine("The server said : " + context.DataFrame.ToString());
}

//...etc

However, there is a problem with how you initialize the WebSocketClient. You should remove the closing parentheses after the closing bracket, to make it look like this.

WebSocketClient("ws://alchemywebsockets.net:81/chat"){
    OnReceive = OnReceive,
    OnSend = OnSend,
    OnConnect = OnConnected,
    OnConnected = OnConnect,
    OnDisconnect = OnDisconnect
  };

Not a big issue, thought I would just suggest it. Doesn't look like this repo gets updated much anyways.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions