Class

JsonrpcServer

Description [src]

class Jsonrpc.Server : GObject.Object {
  parent_instance: GObject
}

A server for JSON-RPC communication

The JsonrpcServer class can help you implement a JSON-RPC server. You can accept connections and then communicate with clients using the JsonrpcClient API.

Hierarchy

None

Ancestors

  • GObject

Constructors

jsonrpc_server_new

Creates a new JsonrpcServer.

Available since: 3.26

Instance methods

jsonrpc_server_accept_io_stream

This function accepts io_stream as a new client to the JsonrpcServer by wrapping it in a JsonrpcClient and starting the message accept loop.

Available since: 3.26

jsonrpc_server_add_handler

Adds a new handler that will be dispatched when a matching method arrives.

Available since: 3.26

jsonrpc_server_foreach

Calls foreach_func for every client connected.

Available since: 3.28

jsonrpc_server_remove_handler

Removes a handler that was previously registered with jsonrpc_server_add_handler().

Available since: 3.26

Signals

Jsonrpc.Server::client-accepted

This signal is emitted when a new client has been accepted.

Available since: 3.28

Jsonrpc.Server::client-closed

This signal is emitted when a new client has been lost.

Available since: 3.30

Jsonrpc.Server::handle-call

This method is emitted when the client requests a method call.

Available since: 3.26

Jsonrpc.Server::notification

This signal is emitted when the client has sent a notification to us.

Available since: 3.26

Class structure

struct JsonrpcServerClass {
  GObjectClass parent_class;
  gboolean (* handle_call) (
    JsonrpcServer* self,
    JsonrpcClient* client,
    const gchar* method,
    GVariant* id,
    GVariant* params
  );
  void (* notification) (
    JsonrpcServer* self,
    JsonrpcClient* client,
    const gchar* method,
    GVariant* params
  );
  void (* client_accepted) (
    JsonrpcServer* self,
    JsonrpcClient* client
  );
  void (* client_closed) (
    JsonrpcServer* self,
    JsonrpcClient* client
  );
  
}
Class members
parent_class
GObjectClass
  No description available.
handle_call
gboolean (* handle_call) (
    JsonrpcServer* self,
    JsonrpcClient* client,
    const gchar* method,
    GVariant* id,
    GVariant* params
  )
  No description available.
notification
void (* notification) (
    JsonrpcServer* self,
    JsonrpcClient* client,
    const gchar* method,
    GVariant* params
  )
  No description available.
client_accepted
void (* client_accepted) (
    JsonrpcServer* self,
    JsonrpcClient* client
  )
  No description available.
client_closed
void (* client_closed) (
    JsonrpcServer* self,
    JsonrpcClient* client
  )
  No description available.

Virtual methods

Jsonrpc.ServerClass.client_accepted
No description available.
Jsonrpc.ServerClass.client_closed
No description available.
Jsonrpc.ServerClass.handle_call
No description available.
Jsonrpc.ServerClass.notification
No description available.