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
  • Reading the port number
  • 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
Allows the server to get information about the current client socket. The current client socket corresponds to the last socket whose message was read by SocketRead.
This function can be used on a server of sockets. This allows you to find out whether a user connected via the socket and to check the validity of connection.
Remarks:
  • UDP-type sockets Allows the server to obtain information on the socket whose last message was read using the SocketRead function.
  • WEBDEV - Código Servidor To use sockets on the server workstation, you need to check the "Allow server sockets" option in the "Advanced" tab of the WEBDEV administrator.
Reminder A socket is a communication resource used by applications to communicate from one machine to another, regardless of the type of network.
Ejemplo
// Add the incoming messages into a table
TableAdd(TABLE_IncomingMsg, "1" + TAB + SocketRead("Server", False) + ...
TAB + SocketClientInfo("server", SocketAddress) + ...
TAB + SocketClientInfo("server", SocketPort))
EDT_SentenceReceivedFromComputerB = SocketRead("ComputerA", False, 2000)
IF EDT_SentenceReceivedFromComputerB <> "" THEN
Info("Message received from the IP address # " + SocketClientInfo("ComputerA", SocketAddress))
END
Sintaxis
<Result> = SocketClientInfo(<Socket name> , <Type of information>)
<Result>: Character string
  • Requested information.
  • Empty string in case of problem.
<Socket name>: Character string
Name of socket defined on the server. This name was defined by SocketCreate (for a simplified server) or by SocketAccept (for a standard server).
WINDEV Warning: The socket name is "case-sensitive".
<Type of information>: Integer constant
Information to retrieve:
SocketAddressIP address of client socket.
SocketPortPort number to which the socket is connected.
Observaciones

Reading the port number

When a server is created on a port, a communication channel is created for each new connected client. This communication channel uses a port, chosen by the system among the available ports. SocketClientInfo returns the port number used by the communication channel.
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.
Clasificación Lógica de negocio / UI: Lógica de negocio
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: 03/04/2025

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