Skip to main content
Open topic with navigation CAPL Functions » TCP/IP API » OnTcpListen

OnTcpListen

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

Method Syntax

Method Syntax

Description

If the CAPL program implements this callback it is called when TcpListen was called and a connection request for the specified socket is received. The connection must be accepted with TcpAccept because the listen socket otherwise remains blocked for other clients. This block is evident for a client in OnTcpConnect from the output of error code 10061 (Connection refused).

Parameters

  • socket: The socket handle or socket object. If the handle is valid (not equal to ~0), it corresponds to the socket that was used for TcpListen.
  • result: The specific result code of the operation. If the operation completed successfully the value is zero. Otherwise the value is an error code.

Return Values

Example

Create TCP Client and Server Sockets