WsOpenListener function (webservices.h)
Initiates "listening" on a specified address. Once a listener is opened channels can be accepted from it. If the open is successful the Listener must be closed using the WsCloseListener function before Listener resources can be released.
Syntax
HRESULT WsOpenListener(
[in] WS_LISTENER *listener,
[in] const WS_STRING *url,
[in, optional] const WS_ASYNC_CONTEXT *asyncContext,
[in, optional] WS_ERROR *error
);
Parameters
[in] listener
A pointer to the Listener object to open. The pointer must reference a valid WS_LISTENER object and the referenced value may not be NULL.
[in] url
A pointer to a object containing the URL address string for the Listener.
[in, optional] asyncContext
A pointer to A WS_ASYNC_CONTEXT object that has information about how to invoke the function asynchronously. The value is set to NULL if invoking synchronously.
[in, optional] error
A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
The asynchronous operation is still pending. |
|
The listener was aborted during the open, or before the open. |
|
The listener is in the incorrect state. |
|
The address is already being used. |
|
The address is not valid for this context. |
|
A quota was exceeded. |
|
The operation was aborted. |
|
The operation did not complete within the time allotted. |
|
Ran out of memory. |
|
One or more arguments are invalid. |
|
This function may return other errors not listed above. |
Remarks
When using IPv6 addresses, they must be enclosed in brackets in the host name portion.
For more information, see WS_HTTP_CHANNEL_BINDING.
For WS_UDP_CHANNEL_BINDING, the path portion of the URL is ignored. If a literal IP address is specified, then it is used to listen, otherwise a wildcard IP address is used.
For WS_TCP_CHANNEL_BINDING, the path portion of the URL is
is matched as a prefix against the received URL.
If a literal IP address is specified, then it is used to listen,
otherwise a wildcard IP address is used.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | webservices.h |
Library | WebServices.lib |
DLL | WebServices.dll |