IC8 Python API:RLPy RTcpClient

From Reallusion Wiki!
Jump to: navigation, search

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.