Olivine-Labs / Alchemy-Websockets

An extremely efficient C# WebSocket server.
http://AlchemyWebsockets.net
Other
309 stars 105 forks source link

Quick Edit to Home Page Website #104

Open brennick opened 10 years ago

brennick commented 10 years ago

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.