node-json-socket
node-json-socket copied to clipboard
'message' event doesnot work if server part is implemented on C#
Could you provide some more info please? Suggested fix?
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);