WebSockets support?

Oct 26, 2013 at 1:42 AM
Hey,

I just stumbled upon this project while searching for a .NET json-rpc Client Implementation for .NET.

Is the WebSockets protocol supported or is it HTTP only? After a quick look at the source code I am worried it does not support WebSockets and therefore can not handle server callbacks.

If its not possible with json-rpc.net, is this a planned feature?
Coordinator
Oct 26, 2013 at 10:55 PM
It is possible, however there is no built-in websocket adapter.

If you follow the documentation to get a console server running, then you should have a good idea of how to integrate it with web sockets.

I currently use this server over a raw socket connection.
Dec 6, 2013 at 8:54 PM
Can you provide us a simple starting example to use it over raw sockets?
Coordinator
Dec 6, 2013 at 10:35 PM
Well if you were using a socket client like:
http://msdn.microsoft.com/en-us/library/bew39x2a(v=vs.110).aspx
and a server like:
http://msdn.microsoft.com/en-us/library/fx6588te(v=vs.110).aspx

Then whenever you receive a string on the server you could pass it to the jsonRpc engine.
https://jsonrpc2.codeplex.com/wikipage?title=Getting%20Started%20%28Console%29&referringTitle=Documentation

and then when the engine has its response ready, you can just send that string back to the client.

You can use the JsonRpcStateAsync to store the socket you want to send the data back on, and then that will make managing which connection receive which response much easier.

I'll see if I can put all that down as a built example later, but you should be able to get it working using those links.