Server
Object Hierarchy:
Description:
[ CCode ( type_id = "jsonrpc_server_get_type ()" ) ]
public class Server : Object
A server for JSON-RPC communication
The Server class can help you implement a JSON-RPC server. You can accept connections and then communicate
with clients using the [class@Client] API.
Content:
Creation methods:
- public Server ()
Creates a new Server.
Methods:
- public void @foreach (Func foreach_func)
Calls foreach_func
for every client connected.
- public void accept_io_stream (IOStream io_stream)
This function accepts io_stream
as a new client to the
Server by wrapping it in a Client and starting the message
accept loop.
- public uint add_handler (string method, owned ServerHandler handler)
Adds a new handler that will be dispatched when a matching
method
arrives.
- public void remove_handler (uint handler_id)
Removes a handler that was previously registered with [method@Server.
Signals:
- public virtual signal void client_accepted (Client client)
This signal is emitted when a new client has been accepted.
- public virtual signal void client_closed (Client client)
This signal is emitted when a new client has been lost.
- public virtual signal bool handle_call (Client client, string method, Variant id, Variant @params)
This method is emitted when the client requests a method call.
- public virtual signal void notification (Client client, string method, Variant @params)
This signal is emitted when the client has sent a notification to us.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref