UDP Server

UDP Server

This module implements the UDP protocol infrastructure. The UDPServer class implments the IServer interface, allowing it to be using with MultimodalDevices and with the MultimodalHub.

class MultimodalMiddlewareProtocol.servers.UDPServer.Datagram(data)

This is a very simple class to store the network address and data of the message to be sent.

Parameters:
  • data (string) – data to be sent
setAddress(address)

Set the network address of this Datagram.

Parameters:
  • address (tuple (ip, port)) – should have an IP and port tuple, containing the destination address of this message.
class MultimodalMiddlewareProtocol.servers.UDPServer.UDPServer(serverIP='', portNumber=6000)

This class implements the UDP server.

Parameters:
  • serverIP (string) – IP address of this server. You can use an empy string for all addresses or an IP for an specific address.
  • portNumber – port number to bind this server. 0 if client.
activate()
getMultimodalHubAddress()
getProtocolId()
getProtocolName()
getServerAddress()
getServerURL()
log(m)
run()
This method should not be called directly. It implements the receiving thread, blocking until data is received from the network and dispatching messages to the registered receiver. The receiver is normally implemented in the MultimodalDevice class and its descendants.
send(destination, data)
sendFields(destination, fields)
setErrorHandler(errorHandler)
setMultimodalHubAddress(address)
setReceiver(receiver)
start()
This method is responsible for starting the receiving thread and the network server. It must be explicity called from all components to activate the server.
stop()
Stops the server and the receiving thread.

Table Of Contents

Previous topic

Streamers

This Page

Quick search