Loading...
Searching...
No Matches
JsonRpc Class Reference

`#include <avogadro/rpc/jsonrpc.h>`

Inheritance diagram for JsonRpc:

## Signals

void | messageReceived (const Avogadro::RPC::Message &message)

## Public Member Functions

| JsonRpc (QObject *parent_=nullptr)
void | addConnectionListener (ConnectionListener *connlist)
void | removeConnectionListener (ConnectionListener *connlist)

## Detailed Description

The JsonRpc class manages ConnectionListener and Connection instances, and emits incoming JSON-RPC Messages.

To use the JsonRpc class, create one or more ConnectionListener instances and call addConnectionListener(). Connect a slot to messageReceived and handle any incoming messages.

Incoming requests with method="internalPing" will be automatically replied to with result="pong". This can be used to test if a server is alive.

## Member Function Documentation

## addConnectionListener()

void addConnectionListener | ( | ConnectionListener * | connlist | ) |

Register a connection listener with this JsonRpc instance. Any incoming connections on the listener will be monitored by this class.

## removeConnectionListener()

void removeConnectionListener | ( | ConnectionListener * | connlist | ) |

Unregister a connection listener from this JsonRpc instance.

## messageReceived

void messageReceived | ( | const Avogadro::RPC::Message & | message | ) |

signal

Emitted when a valid message is received.