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

Tcp-based connection? #37

Open
knocte opened this issue May 30, 2017 · 4 comments
Open

Tcp-based connection? #37

knocte opened this issue May 30, 2017 · 4 comments

Comments

@knocte
Copy link

knocte commented May 30, 2017

Judging by briefly looking at the code (e.g. https://github.com/edjCase/JsonRpc/blob/master/src/EdjCase.JsonRpc.Client/RpcClient.cs), seems like EdjCase.JsonRpc libraries are entirely HTTP-based, instead of transport-agnostic JsonRpc-based. Am I right?

For example, I cannot manage to do the equivalent of this nc command below:

$ nc gh05.geekhosters.com 50001
{ "id": 0, "method": "server.version", "params": [ "1.9.5", "0.6" ] }

The result of that in a Linux terminal, is:

{"id": 0, "result": "1.0"}

Trying the same with EdjCase I get:

Unhandled Exception: System.AggregateException: One or more errors occurred. ---
> EdjCase.JsonRpc.Client.RpcClientUnknownException: Error occurred when trying t
o send rpc requests(s) ---> System.Net.Http.HttpRequestException: An error occur
red while sending the request. ---> System.Net.WebException: The server committe
d a protocol violation. Section=ResponseStatusLine
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
...

Presumably, because I had anyway to use a fake "http://" scheme before the hostname to construct a Uri object first.

Any chance EdjCase can be easily adapted for this use case as well?

@Gekctek
Copy link
Collaborator

Gekctek commented May 31, 2017

Correct. It is dependent on http. I'll look into abstracting out the http context and making it usable through any protocol

@risogolo
Copy link

If you make it also work as a subprotocol and make it work over websockets, that would be also cool.

@knocte
Copy link
Author

knocte commented Jun 19, 2017

Couldn't wait for this so in the end I wrote an implementation myself using TcpClient in F#, will share it soon.

@Gekctek
Copy link
Collaborator

Gekctek commented Jun 21, 2017

Very cool. Been very busy as of late, but I still plan on fixing this issue

@Gekctek Gekctek added this to the 3.0.0 milestone May 20, 2018
@Gekctek Gekctek modified the milestones: 3.0.0, 4.0.0 Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants