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
  • Communication with robots or with non-WINDEV applications
  • Transmission between two stations using different string formats (Unicode and ANSI)
  • 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
Writes a message intended to another socket. This function can be used on a client computer or on a server.
Reminder A socket is a communication resource used by applications to communicate from one machine to another, regardless of the type of network.
Ejemplo
IF SocketWrite("server", "hello world") = True THEN
Message("Message sent")
END
WINDEVReportes y ConsultasJavaCódigo de Usuario (UMC)
IF SocketWrite("Server", "hello world", "www.info.fr", 2005) = True THEN
Message("Message sent")
END
Sintaxis

Writing into a socket Ocultar los detalles

<Result> = SocketWrite(<Socket name> , <Message>)
<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 of the socket that received the message.
In a WINDEV application, this name was defined on the server:
In a WINDEV application, on the client, this name was defined by SocketConnect, SocketConnectSSL or SocketConnectInfrared.
WINDEV Caution: the socket name is case sensitive.
<Message>: String or buffer
Message to transmit. The message format can be defined with SocketChangeTransmissionMode.
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)

Writing into a UDP socket Ocultar los detalles

<Result> = SocketWrite(<Socket name> , <Message> , <Destination address> , <Port number>)
<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 of the socket that received the message. This name has been defined by SocketCreateUDP.
<Message>: Character string
Message to transmit. The message format can be defined with SocketChangeTransmissionMode.
<Destination address>: Character string
Address of the destination computer. This address can be specified as follows:
  • IP address in XXX.XXX.XXX.XXX format (125.5.110.100 for example).
  • URL containing the server name (www.windev.com for example). This syntax is recommended.
  • IP address returned by NetIPAddress.
Socket UDP: The UDP protocol is an "unconnected" protocol. The destination must be specified for each send operation. This address can be a sub-network mask, allowing you to send the message to all the computers connected with this sub-network mask.
<Port number>: Integer
Port number of the target socket.
If you are using a socket associated with a preset protocol, use the port number associated with the protocol.
If this parameter is not specified, the number taken into account corresponds to the last destination port number used for writing for this socket.
Observaciones

Communication with robots or with non-WINDEV applications

To simplify the exchanges of data by socket, a transmission mode is initialized by default.
For a communication with an external module (non-WINDEV application, robot, ...), this transmission mode can prevent the communications from operating properly.
The SocketChangeTransmissionMode function is used to change this transmission mode: the constant SocketSansMarqueurFin constant is used to leave the read and write patterns unchanged.

Transmission between two stations using different string formats (Unicode and ANSI)

When transmitting messages between two workstations using different string formats (e.g. Windows (ANSI) and Windows Mobile (Unicode)), certain conversions may be necessary. These conversions can be made by AnsiToUnicode and UnicodeToAnsi.
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