Setting SQL OpenNet client options in net.ini

The net.ini file enables you to specify an encryption key for the SQL OpenNet client, specify time‑outs, instruct SQL OpenNet to return error codes for communication errors, and set environment variables on the server, as well as other settings for the SQL OpenNet client. When you install Connectivity Series, the installation creates a default net.ini file with default settings (including a default encryption setting). To change settings in net.ini, use a text editor. Note the following:

SQL OpenNet Client Options

Option

Description and syntax

connect_timeout

Specifies the number of seconds for socket connection time‑out. The default is 0 (no time‑out). To set this, use the following syntax, where n is the number of seconds:

connect_timeout n
						

hostenv0

Specifies a comma‑delimited list of environment variables to be passed to and set on the server.

hostenv0 var_name=var_spec[,var_name2=var_spec2,...]
						

key_connect

Specifies a key for the algorithm used to encrypt user names and passwords for the database and for the host (if vtxnetd or vtxnet2 is also started with the ‑k option). This encrypts user names and passwords being sent across the wire. Use the following syntax:

key_connect n
						

where n is any number between 1 and 2147483647. The value for n must be set the same on both the client (where it is set with this net.ini option) and the server (where it is set with the ‑k option on the vtxnetd or vtxnet2 command line). See vtxnetd and vtxnet2 programs.

packetsize

Sets the minimum network packet size used by SQL OpenNet. The default is 8192 bytes. This option defines a minimum size for an aggregate buffer, which is a buffer created when data for multiple network packets needs to be sent to the client. This reduces network traffic by combining packets and sending them as a unit with the specified minimum size. Changing the default packet size may cause performance problems. If you are using a WAN, you may want to change this value to reduce load on the network. The packet size used by the SQL OpenNet server is set by the packetsize setting in the net.ini file on the client.

To set, use the following syntax, where size is the size in bytes:

packetsize size
						

port

Sets the communication port number, which defaults to the vtxnet setting in the services file. For information, see Specifying the port number.

port port_number
						

read_timeout

Specifies how long (in seconds) SQL OpenNet should wait for a read operation to complete. By default this is set to 0, which prevents a time‑out.

read_timeout time
						

return_errno

Instructs SQL OpenNet to return an operating system error code (rather than ‑1) if there’s a communication error. By default return_errno is set to no.

return_errno yes|no
						

write_timeout

Specifies how long (in seconds) SQL OpenNet should wait for a write operation to complete. By default this is set to 0, which prevents a time‑out.

write_timeout time
						

The following example net.ini file sets the encryption key to 6541, sets the packet size to 1300, sets the port to 1990, instructs SQL OpenNet to return error codes for communication errors, sets the read time‑out to 60 seconds, sets the write time‑out to 60 seconds, and sets the ENV1 and ENV2 environment variables on the server.

rem           SQL OpenNet init file
key_connect 6541
packetsize 1300
port 1990
return_errno yes
read_timeout 60
write_timeout 60
hostenv0 ENV1=c:\data,ENV2=c:\data2