Skip to content

Latest commit

 

History

History
148 lines (91 loc) · 4.11 KB

JsonRpcServer.rst

File metadata and controls

148 lines (91 loc) · 4.11 KB

JsonRpcServer

Description

The JsonRpcServer object provides a JSON-RPC 2.0 compliant server. Basic network parameters can be customized through the port <property_JsonRpcServer_port> and localHost <property_JsonRpcServer_localHost> properties. In order to expose functions and properties via JSON-RPC at least one JsonRpcService <object_JsonRpcService> has to be defined and assigned to the services <property_JsonRpcServer_services> property.

› Inherits

Object <object_Object>

Overview

Properties

  • debugRpcMessages <property_JsonRpcServer_debugRpcMessages>
  • localHost <property_JsonRpcServer_localHost>
  • port <property_JsonRpcServer_port>
  • services <property_JsonRpcServer_services>
  • Object.objectId <property_Object_objectId>
  • Object.parent <property_Object_parent>

Methods

  • Object.deserializeProperties() <method_Object_deserializeProperties>
  • Object.fromJson() <method_Object_fromJson>
  • Object.serializeProperties() <method_Object_serializeProperties>
  • Object.toJson() <method_Object_toJson>

Signals

  • servicesDataChanged() <signal_JsonRpcServer_servicesDataChanged>
  • Object.completed() <signal_Object_completed>

Properties

single: debugRpcMessages

debugRpcMessages

This property holds whether to log received and sent RPC messages to the console for debugging purposes.

This property was introduced in InCore 2.2.

› Type

Boolean

› Default

false

› Signal

debugRpcMessagesChanged()

› Attributes

Writable

single: localHost

localHost

This property holds whether the server should listen for incoming connections on the local loopback interface only. If set to true the server will not be reachable by other hosts on the network but internal clients such as docker containers (DockerContainer <object_DockerContainer>) only. Additionally the WebServerService <object_WebServerService> proxies requests to the default port 5080 to a local server. This means if WebServerService <object_WebServerService> is used and the JSON-RPC server should not be exposed on non-local network interfaces a port <property_JsonRpcServer_port> other than 5080 has to be used.

› Type

Boolean

› Default

true

› Signal

localHostChanged()

› Attributes

Writable

single: port

port

This property holds the TCP port of the JSON-RPC server.

› Type

SignedInteger

› Default

5080

› Signal

portChanged()

› Attributes

Writable

single: services

services

This property holds a list of JsonRpcService <object_JsonRpcService> objects which exposes the desired functions and properties.

This property was introduced in InCore 2.5.

› Type

List <object_List><JsonRpcService <object_JsonRpcService>>

› Signal

servicesChanged()

› Attributes

Readonly

Signals

single: servicesDataChanged

servicesDataChanged(SignedInteger index)

This signal is emitted whenever the List.dataChanged() <signal_List_dataChanged> signal is emitted, i.e. the item at index in the services <property_JsonRpcServer_services> list itself emitted the dataChanged() signal.

Example

See JsonRpcService example <example_JsonRpcService> on how to use JsonRpcServer.