- Server parameters
- Username and password
- Receiving messages
In french: NetDémarreServeur
Starts an FTP (File Transfer Protocol) or RPC (Remote Procedure Call) server powered by WINDEV.
ConnectRPC is int
// Connects to an RPC server on port 5010
ConnectRPC = NetStartServer(RPCServer, False, 5010)
<Result> = NetStartServer(<Server> [, <Encryption> [, <Port number> [, <Key> [, <Server IP address>]]]])
- Identifier of the server,
- 0 if the connection failed.
Type of server:
|FTPServer||A WINDEV FTP server is used. The functions for file management are allowed (NetSendFile and NetGetFile for example).|
|RPCServer||A WINDEV RPC server is used.|
<Encryption>: Optional boolean
- True to encrypt the transmitted data,
- False (default value) for no encryption.
If the server is started with the encryption option set to True
, the client computers must connect with NetConnect
by using <Encryption> = True.
If an encryption is requested, the connection key (<Key>) will also be encrypted.
<Port number>: Optional integer
Number of the port on which the server will be run. By default, the client tries to connect to the server:
- on port 2000 for WINDEV RPC.
- on port 2001 for WINDEV FTP.
<Key>: Optional character string
Used to secure the access to the server. Each client trying to connect to the server must use the same key as the one defined by NetStartServer. The connection is refused if the keys are different.
If the <Encryption> parameter is set to True, the key is encrypted.
<Server IP address>: Optional character string
Server IP address. This parameter must be specified if the server has several IP addresses (server using several network cards for example). This IP address can have the following format:
- IP address in XXX.XXX.XXX.XXX format (22.214.171.124 for example).
- IP address containing the server name (pop3.freesbee.eu for example). This syntax is recommended.
- IP address returned by NetIPAddress.
The server parameters are required before a connection is established:
- If the port number is specified, the client will have to use the same port number in NetConnect.
- If the server is started with <Encryption> set to True, the clients must connect with <Encryption> set to True in NetConnect.
- If the server is started with a specific <Key>, the clients must connect by specifying the same <Key> in NetConnect.
The <UserName> and <Password> parameters allow the server to check whether the user is authorized or not. The list of authorizations and passwords for the users is available in the WDRPCSRV.INI file found in the directory of the server project. Example of file content:
USERNAME1 = PASS1
USERNAME2 = PASS2
USERNAME3 = PASS3
The messages are received via events whose number is chosen by the developer.
This page is also available for…