SOCKET FindClient( |
|
UINT nClientId |
|
); |
SOCKET FindClient( |
|
LPCTSTR lpszMoniker |
|
); |
Returns a handle to the client which matches the specified
client ID or moniker.
Parameters
- nClientId
- An unsigned integer the specifies a unique client ID for the
session. This value must be greater than zero.
- lpszMoniker
- A pointer to a string which specifies the client moniker to
search for. This parameter cannot be NULL and cannot specify an
empty string.
Return Value
If the method succeeds, the return value is the handle to the
client socket for the session that matches the specified client ID or moniker. If
the method fails, the return value is INVALID_SOCKET. To get
extended error information, call GetLastError.
Remarks
A client moniker is a string which can be used to uniquely
identify a specific client session aside from its socket handle. A
moniker can be assigned to the client session using the
SetClientMoniker method. This method will search all
active client sessions for the server, and returns the socket handle
to the client that matches the specified moniker. If there is no
match, an error will be returned.
The moniker can be any string value, however monikers are not case
sensitive and may not contain embedded null characters. The maximum
length of a moniker is 127 characters.
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib
Unicode: Implemented as Unicode and ANSI versions.
See Also
GetClientMoniker,
SetClientMoniker
|