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.
Closes down communication with the specified service host.
Syntax
HRESULT WsCloseServiceHost(
[in] WS_SERVICE_HOST *serviceHost,
[in, optional] const WS_ASYNC_CONTEXT *asyncContext,
[in, optional] WS_ERROR *error
);
Parameters
[in] serviceHost
Pointer to a WS_SERVICE_HOST structure that represents the service host to be closed.
[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 current state of the service host is not valid for this operation. |
|
One or more arguments are invalid. |
|
The operation did not complete within the time allotted. |
|
The operation was aborted. |
|
This function may return other errors not listed above. |
Remarks
WsCloseServiceHost closes all listeners on the service host. As a result, no new channels are accepted from the client. However, pending I/O on channels already accepted is allowed to complete.
This has implications for endpoints configured to run with session-based channel bindings. If a client has an open session with a service on such an endpoint, the closure will not complete until the client closes the session with the service.
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 |