Network setup

The work on the network is carried out in RK7 by the NetKern.DLL library. The library uses errors32.dll, dllman.dll, thread32.dll, borlndmm.dll and one or more protocol libraries: tcpsoc.dll(WIN), nbhdup.dll, spxsoc.dll, localnet.dll.

A typical network problem is that dynamic name resolution doesn't work. In this case, the name and address match should be clearly defined (for TCP/IP in the [TCPDNS] section])

Description of sections in the INI file

Section [NETKERN]

The main network settings are located in the [NETKERN] section of the initialization INI file (the default values defined in parentheses):

CANCELONDISCONNECT = 1 — If 0, the server tries to reconnect to the client in case of a disconnect after receiving (sending) an RPC request

CRYPT = 1 — encryption when sending

FILEMANAGERPATH = u:  —  A basic path of file functions (always added to the file name). The * path is processed separately.

IGNOREERRORSFROMSERVER = 1  —  If set to 0, the stack of error codes passed from the server in case of an execution error on the server will be saved in the error file.

LOADALLPROTOCOLS = 1 — If 0, exits RPCInitEx at the first loaded protocol, the rest are loaded asynchronously during the working process. If 1, it does not exit until it loads all the protocols.

MAXSENDRETRYS (2 — CANCELONDISCONNECT)  —  A number of attempts to send a data block

MAXBLOCKSIZE = 20000000 – Maximum packet size (for example, that of the RPC procedure returned data). It must be the same on both the client and the server.

MINPACKSIZE = 15000 – Minimum packet size. In the case of SLOWCONNECT=1 in the protocol settings of one side, a value of 10 times less is used.

MINPACKDELTA = 1000 – Minimum size of reduction during data packing. In the case of SLOWCONNECT=1 in the protocol settings of one side, a value of 10 times less is used.

PROTOCOLS = PROTOCOL\*. DLL — Masks for searching driver DLL files via ";". If the server and the cash register are installed on one and the same device, use localnet.dll.

RETRYRECEIVE = not CANCELONDISCONNECT — Wait for the reconnect to the client to continue receiving the data packet.

ROUTERCOUNT = 2 – The number of routing tasks.

TESTMESSAGES = 0 — If 1, outputs a network operations log in the debug log file

to the debug file ALLSENDLOG = "" – If the value is not empty, then this should be the directory (with the final "\") where the files with the sent data will be stored.

TIMEOUT = (30000/180000)  —  ms.  —  handshake wait timeout and wait timeout of connection send queue (there are different tasks in the queue that use the same connection). If SLOWCONNECT=1 is set in the protocol settings, the queue timeout will be at least 180000, even if a lower value is set.

Section [TCPSOC]  —  Configuring the TCP driver for Windows

The driver reads the [TCPSOC] section of the record from the INI file (default values defined in parentheses):

ASYNCHCONNECT = 1  —  try to connect asynchronously

CHECKSELFNAME = 0  —  try to find a self name during initialization (to avoid duplication).

KEEPALIVE = 1 — send keepalive requests 

LISTEN = 1  —  Wait for connections from others

MAXBUFFER = 65280  — the maximum size of data sent by a single command

SLOWCONNECT = 0 – if 1, changes the default values for MAXBUFFER (4096), TIMEOUT (20000). In addition, the pfSlowConnect driver type flag is set, which uses other timeouts inside NetKern.

DNSFILE = tcpdns.txt – DNS name file.

Format of record in the name decryption file:

Name  address [:port]

Address — a dot-separated Internet address or a computer name in the local network or DNS name
Port — either decimal or hexadecimal (preceded by the $ sign). By default, port = PORT.

For example, for the AA and CC names:


DNSSECTION (TCPDNS)  —  a section in the same file that contains name decryptions.

Format of record in the name decryption section:

Name = address [:port]

For example, for the names AA and CC:


PORT = 5150 – the port number for incoming connections. If port=5150 and there is an error that the port is busy, the number will increase by 1, etc.

PRIORITY = 50 – the driver priority compared to the others (the smaller numbers are viewed first)

TIMEOUT = 4000 – timeout for the operation of MAXBUFFER blocks sending/receiving or connect with ASYNCHCONNECT=1

USEINTERNETDNS =0 – if 1, SENDTO255IP is ignored

RECEIVELOG = "name" – the file name for received data logging

SENDLOG = "name" – the file name for sent data logging

UDP_BROADCAST_PORT = 5160 – the port number for messages exchange (including broadcast) to determine the address by name, must be the same across the entire network

To disable broadcast messages from any server, set UDP_BROADCAST_PORT = 0

SERVERNODELAY = 0  —  if 1, disables the Nagle algorithm for incoming connections, which leads to faster response, but may lead to the channel narrowing.

CLIENTNODELAY = 0  —  the same as SERVERNODELAY, but for outgoing connections

WAITBEFORECLOSE = 0  —  if 1, waits for the network operations completion in case of program disconnection.

SENDTO255IP = 0  —  if 1, in case the address cannot be found by name, tries to reach all 254 addresses of the subnet (USEINTERNETDNS must be 0)

Section [TCPDNS]


Section [NB]  —  NetBIOS driver settings (nb.dll, nbhdup.dll)

The driver reads the [NB] section from the INI file, records (default values defined in parentheses):
TIMEOUT=15000 — timeout of network operations in milliseconds
Listen=1  —  whether to «listen»  —  wait for connection. Only for nb.dll

Recommendations when using a slow communication channel

If a low-speed communication channel is used, the following parameters should be configured: ShortTimeoutLongTimeout both for the reference server (REFSERVER is the main section) and for the manager stations (REFEDIT is the main section).
CollFileCache for the manager station, for storing references in files and synchronizing only changed collections (REFEDIT is the main section).