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.
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_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 |
|
No description available. | |
handle_call |
|
No description available. | |
notification |
|
No description available. | |
client_accepted |
|
No description available. | |
client_closed |
|
No description available. |