FingerConnect Function  
 
HCLIENT WINAPI FingerConnect(
  LPCTSTR lpszRemoteHost,  
  UINT nRemotePort,  
  UINT nTimeout,  
  DWORD dwOptions  
);

Parameters

lpszRemoteHost
A pointer to the name of the server to connect to; this may be a fully-qualified domain name or an IP address.
nRemotePort
The port number the server is listening on; a value of zero specifies that the default port number should be used.
nTimeout
The number of seconds that the client will wait for a response from the server before failing the current operation.
dwOptions
An unsigned integer that specifies one or more options. This parameter is constructed by using a bitwise operator with any of the following values:
Constant Description
FINGER_OPTION_NONE No options specified. This is the default value.
FINGER_OPTION_FREETHREAD This option specifies that the handle returned by this function may be used by any thread, and is not limited to the thread which created it. The application is responsible for ensuring that access to the handle is synchronized across multiple threads.

Return Value

If the function succeeds, the return value is a handle to a client session. If the function fails, the return value is INVALID_CLIENT. To get extended error information, call FingerGetLastError.

Remarks

The dwOptions argument can be used to specify the threading model that is used by the library when a connection is established. By default, the handle is initially attached to the thread that created it. From that point on, until the it is released, only the owner may call functions using that handle. The ownership of the handle may be transferred from one thread to another using the FingerAttachThread function.

Specifying the FINGER_OPTION_FREETHREAD option enables any thread to call any function using the handle, regardless of which thread created it. It is important to note that this option disables certain internal safety checks which are performed by the library and may result in unexpected behavior unless access to the handle is synchronized. If one thread calls a function in the library, it must ensure that no other thread will call another function at the same time using the same handle.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csfgrav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

FingerAsyncConnect, FingerDisconnect, FingerInitialize, FingerUser