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

'message' event doesnot work if server part is implemented on C# #6

Open
keepitsimple opened this issue Mar 16, 2015 · 2 comments
Open

Comments

@keepitsimple
Copy link

No description provided.

@sebastianseilund
Copy link
Owner

Could you provide some more info please? Suggested fix?

@buddyfavors
Copy link

buddyfavors commented Nov 14, 2015

I ran into this issue too but was able to solve it. I think it's because of lack of documentation. Once I looked at how your library functioned I saw the bug in my server.

When your server writes data back to the socket you have to append your json with length + '#'. Otherwise the library didn't know how big the buffer was.

var buffer = Encoding.UTF8.GetBytes(string.Format("{0}#{1}", json.Length, json));
socket.Send(buffer, SocketFlags.None);

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

3 participants