Getting started with client running over TCP? #858
Replies: 3 comments
-
Well, working over a TCP stream should be no problem at all. All StreamJsonRpc needs is a two-way stream (or two one-way streams) to work.
So the Tasks returned by those calls never complete?
Notifications in JSON-RPC are dispatched via regular method invocations, if nothing else. You could implement methods with the names of the methods named in the notifications and then they would be invoked (assuming the parameters match, anyway). Or since you're using an RPC interface, you can define |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response - I've made some progress... I've had some success against a mocked up a series of endpoints, that I've now discovered are a bit more permissible than what the actual endpoint allows. My issue is that I've got no access to the hardware I'm developing against - just an API spec in a PDF file, but I have now managed to execute some tests against the device, but I'm getting RPC errors back, as I'm trying to make the methods fairly generic as I've got about 15-20 methods to exercise, but they are dynamic according to which objects I'm manipulating. As a trivial example - here's the handshake -
What I've discovered is that the method declaration, whether specifying a string, jobject, or dynamic object still is appears to be sent as an an array (taken from wireshark traces) {"jsonrpc":"2.0","id":2,"method":"handshake","params":[""client_supported_versions": [1,2]"]}
from my interface definition:
I can only assume there's a decorator or option that I'm missing, that I just can't spot anywhere Any further help would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
-
I think I've resolved it - or at least started my leap over the first major hurdle! addded |
Beta Was this translation helpful? Give feedback.
-
Hey team - I'm getting myself tied up in knots here - I've managed to make a connection to a remote service, and I'm able to issue requests, but I don't get any messages bubbling up through the code
I'm currently in this situation as the endpoint I'm connecting to was originally defined as a websocket, and had implemented my support for this with no issues, but unfortunately the scope was changed and I'm playing catch up to get this working.
I'm clearly missing something obvious
I can see the messages hitting the wire in wireshark, and being responded to, but if I call my interfacing function, I simply get nothing back
testing the examples yields nothing either:
int myResult = await customerInterfaces.add(1, 2);
await customerInterfaces.AddIngredientAsync("eggs", 2); // equivalent to rpc.InvokeAsync("AddIngredientAsync", "eggs", 2);
Related to this, how do I receive all notifications? The endpoint has a number of implicit notifications that are subscribed to on connect (notify_display_changed, etc)
Beta Was this translation helpful? Give feedback.
All reactions