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

OnTcpSend

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

void OnTcpSend( dword socket, long result, char buffer[], dword size);

Method Syntax

void OnTcpSend( TcpSocket socket, long result, char buffer[], dword size);

Description

If the CAPL program implements this callback it is called when the data from the stack have been processed but not yet placed on the bus. The information is first displayed in the CANoe DE product Trace Window when it has physically been sent.

Parameters

  • socket: The socket handle or socket object.
  • result: The result code of the asynchronous operation. If the operation completed successfully the value is 0. Otherwise the value is an error code.
  • buffer: The buffer provided with the send operation.
  • size: The number of bytes sent.

Return Values

Example

// ---------------------------------------------------
// When asynchronous TcpSend is complete...
// ---------------------------------------------------
void OnTcpSend( dword socket, long result, char buffer[], dword size)
{
  if (socket != ~0)
  {
    // sending data complete.
    If (result != 0)
    {
      writeLineEx(1, 3, "OnTcpSend error: %d", result);
    }
  }
}
Create TCP Client and Server Sockets