WsCloseListener function
Causes the specified listener to stop listening.
Syntax
HRESULT WINAPI WsCloseListener(
_In_ WS_LISTENER* listener,
_In_opt_ const WS_ASYNC_CONTEXT* asyncContext,
_In_opt_ WS_ERROR* error
);
Parameters
- listener [in]
-
Pointer to a WS_LISTENER structure representing the listener to close.
- asyncContext [in, optional]
-
Pointer to a WS_ASYNC_CONTEXT structure containing information for invoking the function asynchronously. Pass NULL to invoke the function synchronously.
- error [in, optional]
-
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
|
Minimum supported client | Windows 7 [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|