Skip to content

Event as Request from JSON Rpc Server #950

@juaal12

Description

@juaal12

Good afternoon!

I am using your package for implementing a json rpc client which connects to a json rpc server (json rpc server is provided by an external client). I am using your package for connecting to the server an executing the methods it provides. So far so good it works like a charm for simple calls.

However, the server has a special functionality where he sends a response when an event is raised inside him. I cannot subscribe to this response and I neither can use NotifyAsync method since this method is not a valid method to call in my server methods. This response looks like this:

{
   "jsonrpc" :  "2.0" ,
   "method" :  "Event.eventOccurred" ,
   "params" : { ... }
   }
}

For managing this special use case I am using a method provided by your package like follows:

jsonRpc.AddLocalRpcMethod("Event.eventOccurred", "Here I will have an async delegate");

As I understand this AddLocalRpcMethod will create a local method to execute when called. I do not know if maybe I am missunderstanding the method or maybe my implementation is not correct but this method seems to never be called which means my async delegate is not executed and my flow cannot continue.

  • Am I doing a proper approach using AddLocalRpcMethod for my use case?
  • Should I do this in a different way? If yes... How can I manage this?
  • Is it possible to receive messages throught the socket without asking for them pointing to an "endpoint" (this would be this case if I am not wrong)?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions