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 codeDescription
WS_S_ASYNC

The asynchronous operation is still pending.

WS_E_OPERATION_ABORTED

The close was aborted by a call to WsAbortListener as the listener was closing.

WS_E_INVALID_OPERATION

The listener was in an inappropriate state.

WS_E_OPERATION_TIMED_OUT

The operation did not complete within the time allotted.

E_INVALIDARG

One or more arguments are invalid.

Other Errors

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

WebServices.h

Library

WebServices.lib

DLL

WebServices.dll

 

 

Community Additions

ADD
Show: