Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick Edit to Home Page Website #104

Open
brennick opened this issue Sep 16, 2014 · 0 comments
Open

Quick Edit to Home Page Website #104

brennick opened this issue Sep 16, 2014 · 0 comments

Comments

@brennick
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant