Home | Sign in | English EN
  • The UDP protocol
  • Operating mode of UDP sockets
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Creates a socket that is using the UDP protocol.
IF SocketCreateUDP("Server", 8000) = False THEN
Error("Creation error" + ErrorInfo(errMessage))
<Result> = SocketCreateUDP(<Socket name> , <Port number> [, <Address>])
<Result>: Boolean
  • True if the function was successful,
  • False otherwise. If an error occurs, you can get the details of the error with ErrorInfo.
<Socket name>: Character string (with quotes)
Name that will be given to the socket. This name will be used by all socket functions.
Caution: the socket name is case sensitive.
<Port number>: Integer
Port number that will be given to the socket. This number must be included between 5000 and 65000. This number will be specified when the client computers are connected to the server.
<Address>: Optional character string (with quotes)
IP address on which the socket must be created on the current computer. If the current computer is associated with several IP addresses (or with several network cards), this parameter enables you to choose the IP address that will be associated with the socket.
This IP address can have the following format:
  • IP address in XXX.XXX.XXX.XXX format ( for example).
  • IP address containing the name of the server (www.WINDEV.com for example). This syntax is recommended.
  • IP address returned by NetIPAddress.

The UDP protocol

When using UDP sockets, there is no notion of connection (as opposed to TCP sockets that are connection-oriented). UDP is a connectionless protocol.
All the UDP sockets, no matter whether they are client sockets or server sockets, are created by SocketCreateUDP.
When a write operation is performed via the UDP protocol, you must specify the destination (address and port).
When a read operation is performed via the UDP protocol, the origin of the string read is unknown. It is returned by SocketClientInfo.
Remark: The UDP protocol is a connectionless protocol, there is no guarantee that the information sent was received.

Operating mode of UDP sockets

A port already opened by another application can be re-opened. The port will be closed during the call to SocketClose or when ending the application that opened it.
Component: wd260com.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment