OnUdpReceiveFrom
Valid for: CANoe DE • CANoe4SW DEFunction Syntax
void OnUdpReceiveFrom( dword socket, long result, dword address, dword port, char buffer[], dword size); // form 1void OnUdpReceiveFrom( dword socket, long result, dword address, dword port, byte buffer[], dword size); // form 2void OnUdpReceiveFrom( dword socket, long result, byte ipv6Address[], dword port, char buffer[], dword size); // form 3void OnUdpReceiveFrom( dword socket, long result, byte ipv6Address[], dword port, byte buffer[], dword size); // form 4void OnUdpReceiveFrom( dword socket, long result, IP_Endpoint remoteEndpoint, char buffer[], dword size); // form 5void OnUdpReceiveFrom( dword socket, long result, IP_Endpoint remoteEndpoint, byte buffer[], dword size); // form 6
Method Syntax
void OnUdpReceiveFrom( UdpSocket socket, long result, dword address, dword port, char buffer[], dword size); // form 1void OnUdpReceiveFrom( UdpSocket socket, long result, dword address, dword port, byte buffer[], dword size); // form 2void OnUdpReceiveFrom( UdpSocket socket, long result, byte ipv6Address[], dword port, char buffer[], dword size); // form 3void OnUdpReceiveFrom( UdpSocket socket, long result, byte ipv6Address[], dword port, byte buffer[], dword size); // form 4void OnUdpReceiveFrom( UdpSocket socket, long result, IP_Endpoint remoteEndpoint, char buffer[], dword size); // form 5void OnUdpReceiveFrom( UdpSocket socket, long result, IP_Endpoint remoteEndpoint, byte buffer[], dword size); // form 6
Description
If the CAPL program implements this callback it is called when an asynchronous receive operation on an UDP socket completes. The stack contains a data queue that is reduced by UdpReceiveFrom as soon as data are located there. So that additional data from the data queue will be received in the future for the socket, UdpReceiveFrom must be called up again within the callback.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.
- address: The numerical remote IPv4 address of the location which sent the data.
- ipv6Address: The remote IPv6 address in a 16 byte array.
- port: The remote port of the location which sent the data in host-byte order.
- buffer: The buffer into which the data was stored.
- size: The number of bytes received.
- remoteEndpoint: The remote endpoint of the location which sent the data.