PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Optimizing the connections for an IP address
  • Time-out
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
Used to establish a secure connection to an SSL server.
Example
IF SocketConnectSSL("Server", 8000, "150.134.20") = False THEN
Error("Connection error" + ErrorInfo(errMessage))
END
Syntax
<Result> = SocketConnectSSL(<Socket Name> , <Port Number> , <Address> [, <SSL Option> [, <Maximum Time-out> [, <Client Certificate>]]])
<Result>: Boolean
  • True if the connection was established,
  • False otherwise. To find out the error details, use ErrorInfo.
<Socket Name>: Character string (with quotes)
Name that will be given to the connection opened on the server socket. This name will be used by all socket functions.
WINDEV Caution: the socket name is case sensitive.
<Port Number>: Integer
Port number of socket. If you are using a socket associated with a preset protocol, use the port number associated with the protocol.
If the socket was created by a WINDEV application, this number must be included between 5 000 and 65 000. In this case, the number must be identical to the port number specified in SocketCreateSSL.
<Address>: Character string (with quotes)
Address of server. If this parameter is not specified, the server is sought on the current 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 name of the server (www.WINDEV.com for example). This syntax is recommended.
WINDEVWEBDEV - Server code The address can also correspond to the IP address returned by NetIPAddress.
<SSL Option>: Optional combination of integer constants
Used to choose the protocol and the identification mode: the combination used by default is ProtocolTLS1.
ProtocolSSL2The SSL2 protocol will be used
ProtocolSSL3The SSL3 protocol will be used
ProtocolTLS1
(default value)
The TLS1 protocol will be used
<Maximum Time-out>: Optional integer or optional Duration
Maximum time-out (in milliseconds) for establishing the connection. This time-out will be used if the server refuses the connection (SocketDeny). In this case, the connection will not be locking.
This parameter can correspond to:
  • an integer corresponding to the number of milliseconds,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
This wait is equal to 10 milliseconds by default.
<Client Certificate>: Certificate variable
Versions 19 and later
Name of the Certificate variable allowing the server to authenticate the client that wants to connect and to check whether this client is allowed to access the server. This certificate must be recognized on the server.
New in version 19
Name of the Certificate variable allowing the server to authenticate the client that wants to connect and to check whether this client is allowed to access the server. This certificate must be recognized on the server.
Name of the Certificate variable allowing the server to authenticate the client that wants to connect and to check whether this client is allowed to access the server. This certificate must be recognized on the server.
Remarks

Optimizing the connections for an IP address

When an IP address is passed to SocketConnectSSL, the connection can be optimized by using the following code:
Socket.Option = SocketOptimizeIPConnection
This option is not enabled by default because the connection may fail in some configurations. However, it may be useful in some applications for which the performances are critical.
Note: To restore the default operating mode, all you have to do is use the SocketOptionDefault constant:
Socket.Option = SocketOptionDefault

Time-out

The time-out specified by <Maximum Time-out> groups the time-out of two steps:
  • the time-out for address resolution: this time-out cannot be configured and it can be optimized (see below).
  • the maximum time-out for the connection to be accepted by the server. Several cases may occur:
    • the server refuses the connection.
    • the server accepts the connection within the time-out
    • the server is not available.
    • the specified address is invalid.
To optimize the time-out for address resolution (time required to find the address), we advise you to:
  • use a DNS on the network. Therefore, this address will be sought toward this server and not for each computer (1 search instead of x searches where x represents the number of computers). Each computer must be registered toward this server.
  • for an IP address, use Socket.Option = SocketOptimizeIPConnection.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment