AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Sockets
  • The UDP protocol
  • Operating mode of UDP sockets
  • Limitation
  • Permisos necesarios
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Creates a socket that uses the UDP protocol.
WEBDEV - Código Servidor To use sockets on the server workstation, check the "Allow server sockets" option in the WEBDEV administrator.
Ejemplo
IF SocketCreateUDP("Server", 8000) = False THEN
	Error("Creation error" + ErrorInfo(errMessage))
END
Sintaxis
<Result> = SocketCreateUDP(<Socket name> , <Port number> [, <Address>])
<Result>: Boolean
  • True if the function was successful,
  • False otherwise. If an error occurs, you can get more details on the error with ErrorInfo.
<Socket name>: Character string
Name that will be given to the socket. This name will be used by all socket functions.
Warning: 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
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.
Observaciones

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: As the UDP protocol is not a connected protocol, it is not possible to be sure of receiving the information sent.

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.
LinuxAndroidWidget Android iPhone/iPadIOS WidgetMac Catalyst

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).
AndroidWidget Android

Permisos necesarios

Esta función cambia los permisos requeridos por la aplicación.
Permiso requerido: INTERNET
Este permiso permite a las aplicaciones abrir los sockets de red.
Componente: wd300com.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 02/04/2025

Señalar un error o enviar una sugerencia | Ayuda local