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

UdpConnect

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

Method Syntax

Method Syntax

Description

The function connects this socket to the given remote endpoint. After the socket is connected it is necessary to use UdpSend instead of UdpSendTo. On Server side it is possible to connect to the remote endpoint when receiving data the first time on a socket. After that a new unconnected Socket can be created to wait for the next incoming udp connection (see example).

Parameters

  • socket: The socket handle.
  • remoteEndpoint: The destination endpoint. IP address and port number must be specified. Example:
    • IP_Endpoint( 192.168.1.1:40001 )
    • IP_Endpoint( [FC00::0001]:40001 )

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.

Example

Client.can

Server.can