network.protocols.jsonrpc.serializer - Palamecia/mint GitHub Wiki

Module

load network.protocols.jsonrpc.serializer

This module provides the Network.JsonRpc.Serializer class which implement the serializer interface for JSON-RPC messages on a stream based end point such as Network.TcpIp. Message objects uses the Network.JsonRpc.Message class.

Packages

Classes

Network.JsonRpc.Serializer

This class provides a serializer for JSON-RPC messages. The message objects uses the Network.JsonRpc.Message class.

Members

Modifiers Member Description
+ const accept Attempts to accept a connection on the end point. This method raises an insta...
+ const appendMessage Appends the message object provided by message to the serializer's buffer. ...
+ const containsMessage Returns true if a message can be constructed from the data in the serialize...
+ const isEmpty Returns true if the serializer's buffer is empty; otherwise returns false.
+ const new Creates a new serializer.
+ const nextMessage Returns the next message object in the serializer's buffer as an instance of ...
- final const nextMessageLength Returns the size of the next message in the buffer in bytes or none if the ...
+ const read Attempts to read data from the end point. Returns true if data was receive;...
- final stream Internal buffer.
+ const write Attempts to write data to the end point. Returns true if the data was succe...

Descriptions

Network.JsonRpc.Serializer.accept

def (self, endpoint)

Attempts to accept a connection on the end point. This method raises an instance of Exception.InvalidNetworkOperation.

Network.JsonRpc.Serializer.appendMessage

def (self, message)

Appends the message object provided by message to the serializer's buffer. The message parameter must be an instance of Network.JsonRpc.Message.

Network.JsonRpc.Serializer.containsMessage

def (const self)

Returns true if a message can be constructed from the data in the serializer's buffer (i.e. a full JSON-RPC message was added); otherwise returns false.

Network.JsonRpc.Serializer.isEmpty

def (const self)

Returns true if the serializer's buffer is empty; otherwise returns false.

Network.JsonRpc.Serializer.new

def (self)

Creates a new serializer.

Network.JsonRpc.Serializer.nextMessage

def (self)

Returns the next message object in the serializer's buffer as an instance of Network.JsonRpc.Message or none if no message object can be constructed from the data in the buffer. The data used to create the message is then removed from the buffer.

Network.JsonRpc.Serializer.nextMessageLength

def (self)

Returns the size of the next message in the buffer in bytes or none if the size un unknown. The size include the header and the body.

Network.JsonRpc.Serializer.read

def (self, endpoint)

Attempts to read data from the end point. Returns true if data was receive; otherwise returns false.

Network.JsonRpc.Serializer.stream

null

Internal buffer.

Network.JsonRpc.Serializer.write

def (self, endpoint)

Attempts to write data to the end point. Returns true if the data was successfully sent; otherwise returns false. After this call, the sent data is removed from the buffer.