PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Communication with robots or with non-WINDEV applications
  • Transmission between two computers that use character strings in different formats (UNICODE and ANSI)
  • 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
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 the applications to communicate between computers regardless of the network type.
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 22 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 22
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
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 SocketWrite("server", "hello world") = True THEN
Message("Message sent")
END
WINDEVReports and QueriesUniversal Windows 10 AppJavaUser code (UMC)
IF SocketWrite("Server", "hello world", "www.info.fr", 2005) = True THEN
Message("Message sent")
END
Syntax

Writing into a socket Hide the details

<Result> = SocketWrite(<Socket Name> , <Message>)
<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 of 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>: Character string (with quotes) or buffer
Message to transmit. The message format can be defined by SocketChangeTransmissionMode.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileUniversal Windows 10 AppJavaUser code (UMC)

Writing into a UDP socket Hide the details

<Result> = SocketWrite(<Socket Name> , <Message> , <Destination Address> , <Port Number>)
<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 of socket that received the message. This name was defined by SocketCreateUDP.
<Message>: Character string (with quotes)
Message to transmit. The message format can be defined by SocketChangeTransmissionMode.
<Destination Address>: Character string (with quotes)
Address of the destination computer. This address can be given in the following format:
  • 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.
UDP socket: The UDP protocol is a "connectionless" 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.
Remarks

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.
SocketChangeTransmissionMode is used to change this transmission mode: the SocketNoEndTag constant allows you not to modify the frames read and written.

Transmission between two computers that use character strings in different formats (UNICODE and ANSI)

Some conversions may be required when messages are transmitted between two computers that use character strings in different formats (Windows (ANSI) and Windows Mobile (UNICODE) for example). These conversions can be performed by AnsiToUnicode and UnicodeToAnsi.
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
WEBDEV - Browser code WDJS.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