Skip to main content

OnTlsClose

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

void OnTlsClose(dword socketHandle, int result);

Description

If the CAPL program implements this callback it is called when the peer closes the tls connection while a receive call is pending.

Parameters

  • socket: The TLS socket handle. If the handle is valid (not equal to ~0), it corresponds to the socket that was used for tlsOpen.
  • result: The specific TLS result code. If the peer has closed the connection, the result is 4 (PeerClosed).

Return Values

Example

void OnTlsClose(dword socketHandle, int result)
{
  if(result == 4)
  {
    write("peer closed tls connection");
    TlsClose(socketHandle, 1);
  }
}