Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Causes the specified listener to stop listening.
Syntax
HRESULT WsCloseListener(
[in] WS_LISTENER *listener,
[in, optional] const WS_ASYNC_CONTEXT *asyncContext,
[in, optional] WS_ERROR *error
);
Parameters
[in] listener
Pointer to a WS_LISTENER structure representing the listener to close.
[in, optional] asyncContext
Pointer to a WS_ASYNC_CONTEXT structure containing information for invoking the function asynchronously. Pass NULL to invoke the function synchronously.
[in, optional] error
Pointer to a WS_ERROR structure that receives additional error information if the function fails.
Return value
If the function succeeds, it returns NO_ERROR; otherwise, it returns an HRESULT error code.
Return code | Description |
---|---|
|
The asynchronous operation is still pending. |
|
The close was aborted by a call to WsAbortListener as the listener was closing. |
|
The listener was in an inappropriate state. |
|
The operation did not complete within the time allotted. |
|
One or more arguments are invalid. |
|
This function may return other errors not listed above. |
Remarks
After the listener is closed, the listener can safely be released.
This operation is allowed for listener in the WS_LISTENER_STATE_OPEN or WS_LISTENER_STATE_FAULTED state. (For listener states, see the WS_LISTENER_STATE enumeration.)
When a listener is closed, any pending attempts to accept a channel with the WsAcceptChannel method are aborted. However, WsCloseListener waits for any pending I/O to complete before proceeding with the closing process.
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 |