CmpTlsRead (FUN)

FUNCTION CmpTlsRead : __XINT

Receive data from the encrypted channel. If the connection is not established yet, this will be done transparent in the background. Normally only data is of the encrypted channel is consumed. In some cases (Handshaking has not finished or renegotiation of the session keys) this function will also write data. If the unterlaying IO doens’t write automatically the need to send data will be indicated using the corresponding error code.

InOut:

Scope

Name

Type

Comment

Return

CmpTlsRead

__XINT

Number of bytes received. 0 if an error occured.

Input

hTlsConn

RTS_IEC_HANDLE

Handle of the TLS connection, created with one of the TLSxxxOpen functions

pbyBuffer

POINTER TO BYTE

Pointer to a databuffer, where the received decrypted data should be written to.

xiBufferSize

__XINT

Size of pbyData. Maximum number of bytes, that could be received from the TLS connection.

pResult

POINTER TO RTS_IEC_RESULT

Result OF THIS operation. May be one OF these values:
  • ERR_OK: No error. Everything worked as expected.

  • ERR_NOTINITIALIZED: The TLS component was not initialized proberly.

  • ERR_TLS_CONNECTION_CLOSED: The TLS connection is closed. Use TlsShutdown to shutdown locally.

  • ERR_TLS_WANT_READ: The operation needs TO read data FROM the IO system. There is no data available.

  • ERR_TLS_WANT_WRITE: The operation needs to write data to the IO system. This is not possible.

  • ERR_TLS_RETRY_OPERATION: Something went wrong. Try the same function call again

  • ERR_TLS_IO_SYSTEM: An error in the unterlaying IO system.

  • ERR_TLS_INTERNAL: An internal Error of the TLS Component

  • ERR_FAILED: Unknown error.