PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Re-creating a socket
  • Re-using an address that is already used
  • Connecting to an infrared port
  • Required permissions
  • Required application feature
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. A socket is a communication resource used by the applications to communicate between computers regardless of the network type.
Notes:
  • This function must be called on the server used for the communication. If the client computer is using a WINDEV application to connect to this socket, this application will have to use SocketConnect.
  • SSL sockets: To create an SSL socket, use SocketCreateSSL.
  • UDP sockets: To create a UDP socket, use SocketCreateUDP.
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.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad 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.
IF SocketCreate("Server", 8000) = False THEN
Error("creation error" + ErrorInfo(errMessage))
END
Syntax
<Result> = SocketCreate(<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 1 and 65000. This number will be specified when the client computers are connected to the server.
LinuxAndroidAndroid Widget iPhone/iPad 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).
<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.
WINDEVWEBDEV - Server code The IP address is also returned by NetIPAddress.
Remarks

Re-creating a socket

If a socket is not closed properly by SocketClose (restarting the computer for example), re-creating the socket may take quite a long time. Indeed, you will have to wait until the socket is freed by the system.
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileJavaPHPUser code (UMC)

Re-using an address that is already used

By default, SocketCreate allows you to re-use an address that is already used (by the application itself or by another application). To forbid this operating mode, type the following code line:
Socket.Option = SocketNoReuseAddress
Note: Therefore, this option allows you to find out whether an address or a port is already used. In this case, SocketCreate returns an error.
WINDEVReports and QueriesWindows MobileUser code (UMC)

Connecting to an infrared port

To connect to a socket that is using an infrared port:
  1. Create a socket using the infrared port on the server (SocketCreateInfrared in a WINDEV application).
  2. In the client application (WINDEV application), use SocketConnectInfrared to connect to this socket.
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.
Versions 23 and later
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Family and corporate networks
This feature allows the applications to use incoming and outgoing accesses to the family and corporate networks.
New in version 23
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Family and corporate networks
This feature allows the applications to use incoming and outgoing accesses to the family and corporate networks.
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Family and corporate networks
This feature allows the applications to use incoming and outgoing accesses to the family and corporate networks.
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