PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • The UDP protocol
  • Operating mode of UDP sockets
  • Limitation
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Creates a socket that is using the UDP protocol.
WEBDEV - Server code To use sockets on the server, "Allow the server sockets" must be checked in the WEBDEV administrator.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Versions 23 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 23
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
IF SocketCreateUDP("Server", 8000) = False THEN
Error("Creation error" + ErrorInfo(errMessage))
END
Syntax
<Result> = SocketCreateUDP(<Socket Name> , <Port Number> [, <Address>])
<Result>: Boolean
  • True if the function was successful,
  • False otherwise. To find out the error details, use 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 (125.5.110.100 for example).
  • IP address containing the name of the server (www.WINDEV.com for example). This syntax is recommended.
  • IP address returned by NetIPAddress.
Remarks

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.
Note: 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.
LinuxAndroidAndroid Widget iPhone/iPad

Limitation

You must be "root" to create a socket on a port less than or equal to 1024 (being "root" means being the user who has all the permissions on the system).
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission : INTERNET
This permission allows the applications to open the network sockets.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Java wd230java.jar
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment