You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is in example registration of EVENT_MESSAGE event nested (doubled)?
var socket = new Socket("ws://localhost");
socket.On(Socket.EVENT_OPEN, () =>
{
socket.On(Socket.EVENT_MESSAGE, (data) =>
{
socket.On(Socket.EVENT_MESSAGE, (data) => Console.WriteLine((string)data));
});
});
socket.Open();
I'm using in my app only single socket.On(Socket.EVENT_MESSAGE, (data) => {...}); after opening the socket and all works fine. Is there any reason for nested registration, or it is only mistake in example code?