Switch to: V11V10V9V8V7V6V5

VConnection Class: Construction Methods

Declaration:

Constructor( 	
	inHost as String, 
	inUserName as String, 
	inUserPassword as String, 
	inPort as Integer = 15432,
	inTimeOut as Integer = 5,
	inOptions as String = "" )

Parameters:

  • inHost - The IP-address or DNS name of the host.
  • inUserName - The user name.
  • inUserPassword - The user password.
  • inPort - The port number that listens to the Server on inHost. By default it is the standard port of Valentina Server.
  • inTimeOut - TimeOut in seconds to wait for a Server response.
  • inOptions - A string of additional options.

Description:

This method constructs a VConnection object. This constructor simply stores parameters and does not try to connect. The real connection occurs using the Open() method.

inTimeOut parameter specifies how much seconds we want to wait while DNS is looking for the required server. If during this N seconds server is not reached by TCP/IP protocol then we get “stream error” message.

[NEW in v4.0]

If the required server is found and you have not unlimited license then the “pool of connections” of VServerinto may come to the game. Let` assume that license of a VServer allows K simultaneous connections. Let you try to establish one more K+1 connection. The license does not allow this. But Valentina Server will not refuse your request immediately. It will pool this connection request to wait MaxConnectionTimeout seconds in hope that some existed connection will be released. If this happens then VServer opens connection for you. If during MaxConnectionTimeout any connection was not released, then you will get an error message that the connection was not established (in this case you need try it again).

Example:

dim connection as VConnection
 
connection = new VConnection( "localhost", "sa", "sa" )
or
connection = new VConnection( "123.456.789.123", "sa", "sa" )