UdpSend
CAPL Functions » TCP/IP API » UdpSend Valid for: CANoe DE • CANoe4SW DEFunction Syntax
long UdpSend( dword socket, char buffer[], dword size); // form 1long UdpSend( dword socket, struct data, dword size); // form 2long UdpSend( dword socket, byte buffer[], dword size); // form 3
Method Syntax
long socket.Send(char buffer[], dword size); // form 1long socket.Send(struct data, dword size); // form 2long socket.Send(byte buffer[], dword size); // form 3
Description
The function sends data on a connected UDP socket. It is necessary to connect the socket with UdpConnect before calling this function.Parameters
- socket: The socket handle.
- buffer: The buffer containing the data to be sent.
- data: The struct containing the data to be sent.
- size: The size of the data to be sent.
Return Values
- 0: The function completed successfully.
- WSA_INVALID_PARAMETER (87): The specified socket was invalid.
- SOCKET_ERROR (-1): The function failed. Call IpGetLastSocketError to get a more specific error code.