network.serializers.datagram - Palamecia/mint GitHub Wiki
Module network.serializers.datagram
Description
load network.serializers.datagram
This module provides the datagram serializer helpers used with datagram-based endpoints such as UDP sockets.
Packages
Classes
Network.AsyncDatagramSerializer
This class provides a serializer for datagram based end points. It should be used with instances of Network.EventChannel created with an instance of Network.UdpIp. The data is exchanged asynchronously.
Public members
| Modifiers | Member | Description |
|---|---|---|
| accept | Attempts to accept a connection asynchronously on the end point. This method ... | |
const |
appendMessage | Pushes the datagram described by datagram to the serializer's queue. |
const |
containsMessage | Returns true if the serializer's queue contains at least one datagram; otherw... |
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 datagram in the serializer's queue or none if the queue is e... |
| read | Attempts to read data asynchronously from the socket. Returns true if data wa... |
|
| write | Attempts to write data asynchronously to the socket. Returns true if the data... |
Private members
| Modifiers | Member | Description |
|---|---|---|
final |
datagramQueue | Internal datagram queue. |
Network.Datagram
This class provides a representation for a datagram.
Public members
| Modifiers | Member | Description |
|---|---|---|
const |
data | Returns the datagram's data. |
const |
getEndpoint | Returns the datagram's end point. |
const |
new | Creates a new datagram for the data given by the data parameter. If this para... |
const |
size | Returns the datagram's size. |
Private members
| Modifiers | Member | Description |
|---|---|---|
final |
buffer | Internal data buffer. |
final |
endpoint | Internal peer end point. |
Network.DatagramSerializer
This class provides a serializer for datagram based end points. It should be used with instances of Network.EventChannel created with an instance of Network.UdpIp.
Public members
| Modifiers | Member | Description |
|---|---|---|
const |
accept | Attempts to accept a connection on the end point. This method raises an insta... |
const |
appendMessage | Pushes the datagram described by datagram to the serializer's queue. |
const |
containsMessage | Returns true if the serializer's queue contains at least one datagram; otherw... |
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 datagram in the serializer's queue or none if the queue is e... |
const |
read | Attempts to read data from the socket. Returns true if data was receive; othe... |
const |
write | Attempts to write data to the socket. Returns true if the data was successful... |
Private members
| Modifiers | Member | Description |
|---|---|---|
final |
datagramQueue | Internal datagram queue. |
Descriptions
Network.AsyncDatagramSerializer.accept
def (self, endpoint)
Attempts to accept a connection asynchronously on the end point. This method raises an instance of Exception.InvalidOperation.
Network.AsyncDatagramSerializer.appendMessage
def (self, datagram)
Pushes the datagram described by datagram to the serializer's queue.
Network.AsyncDatagramSerializer.containsMessage
def (const self)
Returns true if the serializer's queue contains at least one
datagram; otherwise returns false.
Network.AsyncDatagramSerializer.datagramQueue
null
Internal datagram queue.
Network.AsyncDatagramSerializer.isEmpty
def (const self)
Returns true if the serializer's buffer is empty; otherwise
returns false.
Network.AsyncDatagramSerializer.new
def (self)
Creates a new serializer.
Network.AsyncDatagramSerializer.nextMessage
def (self)
Returns the next datagram in the serializer's queue or none if the
queue is empty. The datagram is then removed from the queue.
Network.AsyncDatagramSerializer.read
def (self, socket)
Attempts to read data asynchronously from the socket. Returns true if data was receive; otherwise returns
false.
Network.AsyncDatagramSerializer.write
def (self, socket)
Attempts to write data asynchronously to the socket. Returns true if the data was successfully sent;
otherwise returns false. After this call, the sent data is removed from the buffer.
Network.Datagram.buffer
null
Internal data buffer.
Network.Datagram.data
def (self)
Returns the datagram's data.
Network.Datagram.endpoint
null
Internal peer end point.
Network.Datagram.getEndpoint
def (self)
Returns the datagram's end point.
Network.Datagram.new
def (self, data)
Creates a new datagram for the data given by the data parameter.
If this parameter is an instance of Network.Datagram, this object
is returned as the new instance; otherwise the object is used for
the data to be sent using the datagram.
def (self, data, endpoint)
Creates a new datagram for the data given by the data parameter.
The datagram is associated to the endpoint.
Network.Datagram.size
def (self)
Returns the datagram's size.
Network.DatagramSerializer.accept
def (self, endpoint)
Attempts to accept a connection on the end point. This method raises an instance of Exception.InvalidOperation.
Network.DatagramSerializer.appendMessage
def (self, datagram)
Pushes the datagram described by datagram to the serializer's queue.
Network.DatagramSerializer.containsMessage
def (const self)
Returns true if the serializer's queue contains at least one
datagram; otherwise returns false.
Network.DatagramSerializer.datagramQueue
null
Internal datagram queue.
Network.DatagramSerializer.isEmpty
def (const self)
Returns true if the serializer's buffer is empty; otherwise
returns false.
Network.DatagramSerializer.new
def (self)
Creates a new serializer.
Network.DatagramSerializer.nextMessage
def (self)
Returns the next datagram in the serializer's queue or none if the
queue is empty. The datagram is then removed from the queue.
Network.DatagramSerializer.read
def (self, socket)
Attempts to read data from the socket. Returns true if data was receive; otherwise returns false.
Network.DatagramSerializer.write
def (self, socket)
Attempts to write data to the socket. Returns true if the data was successfully sent; otherwise returns
false. After this call, the sent data is removed from the buffer.