IC8 Python API:RLPy RTcpClient
Contents
- 1 Description
- 2 Constructor & Destructor
- 3 Member Functions
- 3.1 Connect (self, strIP, uPort)
- 3.2 Disconnect (self)
- 3.3 GetData (self, pBuffer)
- 3.4 GetDataAt (self, nIndex, pBuffer)
- 3.5 GetDataCount (self)
- 3.6 GetDataSize (self, *args)
- 3.7 GetMaximumDataCount (self)
- 3.8 IsConnected (self)
- 3.9 RegisterCallback (self, pCallback)
- 3.10 SendData (self, pBuffer, nDataSize)
- 3.11 SetMaximumDataCount (self, nCount)
- 3.12 UnregisterCallback (self)
- 4 Properties
Description
This class is used to receive TCP/IP data. The Transmission Control Protocol provides reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network. The RTcpClient is used to receive such data. This class use queue to store the received data. The developer can set the buffer size for storing the maximum data counts by using SetMaximumDataCount(), the default value is 60. When the total data counts received is greater than the maximum buffer counts, the previously received data will be removed. Getting data have to specify index to get the data which developer wants in the buffer and create a container of the same size as the data, then copy data to the container by using GetDataSize() and GetData(). The following is an example to use this class:
Constructor & Destructor
__init__ (self)
Initializes a new tcp client instance.
Member Functions
Connect (self, strIP, uPort)
Connect to server.
Parameters
- strIP
- uPort
Disconnect (self)
Disconnects this TCP client from its remote endpoint.
GetData (self, pBuffer)
copy latest data to buffer
Parameters
- pBuffer
GetDataAt (self, nIndex, pBuffer)
copy the data to pBuffer according to the specific index
Parameters
- nIndex
- pBuffer
GetDataCount (self)
Get the counts of data in the buffer.
GetDataSize (self, *args)
Get data's size according to the specific index.
Parameters
- args
GetMaximumDataCount (self)
return buffer's maximum amount
IsConnected (self)
Get the current connection status of the client.
RegisterCallback (self, pCallback)
Register network TCP event callback.
Parameters
- pCallback
SendData (self, pBuffer, nDataSize)
Write data to the device.
Parameters
- pBuffer
- nDataSize
SetMaximumDataCount (self, nCount)
Set buffer the maximum amount of received data.
Parameters
- nCount
UnregisterCallback (self)
Unregister network TCP event callback.
Properties
thisown
Indicates whether this SWIG proxy owns the underlying C++ object.