TestCenter Reference
|
The Communicator is the superclass for the communicating entities. More...
Public Member Functions | |
def | __init__ (self) |
def | getPort (self) |
Get the port used for connections. More... | |
def | isConnected (self) |
Get the connection status of the IPC client. More... | |
def | send (self, data, timeout) |
Send the data via the socket using the given timeout. More... | |
def | recv (self, timeout) |
Receive data via the socket using the given timeout. More... | |
def | getLastError (self) |
Get a tuple describing the last error. More... | |
def | getLastErrorWithMessage (self) |
Get a tuple describing the last error. More... | |
The Communicator is the superclass for the communicating entities.
This class contains the fundamental routines for sending messages between the two entities master and slave. The communication protocol consists of two parts. First the length of the message is sent via a string with exactly 16 bytes. This fixed length is essential as with asynchronous communication many non obvious things can happen (like only parts of messages being transmitted or concatenation of successivly sent messages). The second part of the communication protocol sends the actual data in junks of a given size.
def TestCenterAdvanced.IPC.Communicator.__init__ | ( | self | ) |
Reimplemented in TestCenterAdvanced.IPC.ComSlave.
Definition at line 60 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._csocket, TestCenterAdvanced.IPC.ComSlave._csocket, TestCenterAdvanced.IPC.Communicator._mConnected, TestCenterAdvanced.IPC.ComMaster._mConnected, TestCenterAdvanced.IPC.ComSlave._mConnected, TestCenterAdvanced.IPC.Communicator._mErrorCode, TestCenterAdvanced.IPC.ComMaster._mErrorCode, TestCenterAdvanced.IPC.Communicator._mErrorMsg, TestCenterAdvanced.IPC.ComMaster._mErrorMsg, TestCenterAdvanced.IPC.Communicator._mHost, TestCenterAdvanced.IPC.Communicator._mPort, TestCenterAdvanced.IPC.ComMaster._mPort, TestCenterAdvanced.IPC.Communicator._msocket, and TestCenterAdvanced.IPC.ComMaster._msocket.
def TestCenterAdvanced.IPC.Communicator.getLastError | ( | self | ) |
Get a tuple describing the last error.
Each failure event sets an internal error code which can be read using this method.
Definition at line 213 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._mErrorCode, and TestCenterAdvanced.IPC.ComMaster._mErrorCode.
def TestCenterAdvanced.IPC.Communicator.getLastErrorWithMessage | ( | self | ) |
Get a tuple describing the last error.
Each failure event sets an internal error code which can be read using this method.
Definition at line 221 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._mErrorCode, TestCenterAdvanced.IPC.ComMaster._mErrorCode, TestCenterAdvanced.IPC.Communicator._mErrorMsg, TestCenterAdvanced.IPC.ComMaster._mErrorMsg, TestCenterAdvanced.IPC.ComMaster.disconnect(), and TestCenterAdvanced.IPC.ComSlave.disconnect().
def TestCenterAdvanced.IPC.Communicator.getPort | ( | self | ) |
Get the port used for connections.
Definition at line 82 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._mPort, and TestCenterAdvanced.IPC.ComMaster._mPort.
def TestCenterAdvanced.IPC.Communicator.isConnected | ( | self | ) |
Get the connection status of the IPC client.
Definition at line 89 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._mConnected, TestCenterAdvanced.IPC.ComMaster._mConnected, and TestCenterAdvanced.IPC.ComSlave._mConnected.
def TestCenterAdvanced.IPC.Communicator.recv | ( | self, | |
timeout | |||
) |
Receive data via the socket using the given timeout.
This method implements the receiving part of the protocol specified in the description of send. This method returns True if it succeeded sending the data, False otherwise.
Definition at line 155 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._csocket, TestCenterAdvanced.IPC.ComSlave._csocket, TestCenterAdvanced.IPC.Communicator._handleError(), TestCenterAdvanced.IPC.Communicator._mConnected, TestCenterAdvanced.IPC.ComMaster._mConnected, TestCenterAdvanced.IPC.ComSlave._mConnected, and TestCenterAdvanced.IPC.Communicator._recv().
def TestCenterAdvanced.IPC.Communicator.send | ( | self, | |
data, | |||
timeout | |||
) |
Send the data via the socket using the given timeout.
This method returns True if it succeeded sending the data, False otherwise.
Definition at line 97 of file IPC.py.
References TestCenterAdvanced.IPC.Communicator._csocket, TestCenterAdvanced.IPC.ComSlave._csocket, TestCenterAdvanced.IPC.Communicator._handleError(), TestCenterAdvanced.IPC.Communicator._mConnected, TestCenterAdvanced.IPC.ComMaster._mConnected, TestCenterAdvanced.IPC.ComSlave._mConnected, TestCenterAdvanced.IPC.Communicator._mMsgLength, and TestCenterAdvanced.IPC.Communicator._send().