network.serializers.text - Palamecia/mint GitHub Wiki

Module

load network.serializers.text

This module provides the Network.TextSerializer class which implement the serializer interface for plain text messages on a stream based end point such as Network.TcpIp.

Packages

Classes

Network.TextSerializer

This class provides a serializer for plain text messages. The message end is detected by finding a byte with a value of 0.

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 a string or n...
+ 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.TextSerializer.accept

def (self, endpoint)

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

Network.TextSerializer.appendMessage

def (self, message)

Appends the message object provided by message to the serializer's buffer. The message parameter must be a string or castable to string.

Network.TextSerializer.containsMessage

def (const self)

Returns true if a message can be constructed from the data in the serializer's buffer (i.e. at least one byte with a value of 0 was found); otherwise returns false.

Network.TextSerializer.isEmpty

def (const self)

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

Network.TextSerializer.new

def (self)

Creates a new serializer.

Network.TextSerializer.nextMessage

def (self)

Returns the next message object in the serializer's buffer as a string 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.TextSerializer.read

def (self, endpoint)

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

Network.TextSerializer.stream

null

Internal buffer.

Network.TextSerializer.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.