network.endpoints.udpip - Palamecia/mint GitHub Wiki
Module
load network.endpoints.udpip
This module provides the Network.UdpIp class which implement the Network.EndPoint interface for the UDP/IP protocol.
Packages
Classes
Network.UdpIp
This class provides an end point implementation for communication with a peer device using the UDP/IP protocol.
Inherits
Members
Modifiers | Member | Description |
---|---|---|
+ override const |
bind | Tells the end point to listen for incoming messages. Returns true on succes... |
+ override const |
connect | Attempts to make a connection to the remote device. Returns true if connect... |
- @ |
g_lib | Global library handle. |
+ const |
getPort | Returns the UDP port number used by the end point. |
+ const |
new | Creates a new end point for any IP address and any UDP port. This endpoint is... |
+ const |
open | Attempts to open the socket without connection to the remote device. Returns ... |
- final |
port | Internal UDP port. |
+ override const |
read | Returns all available data received from the peer as an instance of Serialize... |
+ const |
readFrom | Returns an iterator containing the available data received from any peer as a... |
+ override const |
write | Sends the data described by the data parameter to the peer. The data para... |
+ const |
writeTo | Sends the data described by the data parameter to the peer accessible with ... |
Descriptions
Network.UdpIp.bind
def (self)
Tells the end point to listen for incoming messages. Returns true
on success; otherwise returns false
.
An instance of Exception.SocketError is raised on error.
Network.UdpIp.connect
def (self)
Attempts to make a connection to the remote device. Returns true
if
connection succed or if the connection request was successfully sent
and is waiting for acknowledgment; otherwise returns false
.
An instance of Exception.SocketError is raised on error.
Network.UdpIp.g_lib
lib ('libmint-network')
Global library handle.
Network.UdpIp.getPort
def (const self)
Returns the UDP port number used by the end point.
Network.UdpIp.new
def (self)
Creates a new end point for any IP address and any UDP port. This endpoint is mean to be used with the writeTo and readFrom methods and can only be opened using the open method.
def (self, address, port)
Creates a new end point for the IP address descibed by address
and
the UDP port descibed by port
.
Network.UdpIp.open
def (self)
Attempts to open the socket without connection to the remote device.
Returns true
if the socket was correctly opened; otherwise returns
false
.
An instance of Exception.SocketError is raised on error.
Network.UdpIp.port
0
Internal UDP port.
Network.UdpIp.read
def (self)
Returns all available data received from the peer as an instance of
Serializer.DataStream or none
if no data is available.
An instance of Exception.SocketError is raised on error.
Network.UdpIp.readFrom
def (self)
Returns an iterator containing the available data received from any
peer as an instance of Serializer.DataStream ans an instance of
Network.UdpIp initialized (but not connected) with the informations
of that peer. This endpoint can be used to open a dedicated channel
with that peer. Returns none
if no data is available.
An instance of Exception.SocketError is raised on error.
Network.UdpIp.write
def (self, data)
Sends the data described by the data
parameter to the peer. The
data
parameter must be an instance of Serializer.DataStream.
Returns an iteraror containing true
and the amount of sent data in
bytes if the data was successfully sent to the peer; otherwise returns
false
.
An instance of Exception.SocketError is raised on error.
Network.UdpIp.writeTo
def (self, address, port, data)
Sends the data described by the data
parameter to the peer accessible
with the IP address descibed by address
and the UDP port descibed by
port
. The data
parameter must be an instance of Serializer.DataStream.
Returns an iteraror containing true
and the amount of sent data in
bytes if the data was successfully sent to the peer; otherwise returns
false
.
An instance of Exception.SocketError is raised on error.