## EXPORT_SPEC int UpnpUnSubscribeAsync

## ( IN UpnpClient_Handle Hnd,
IN Upnp_SID SubsId,
IN Upnp_FunPtr Fun,
IN const void* Cookie )

> UpnpUnSubscribeAsync removes a subscription of a control point from a service previously subscribed to using UpnpSubscribe or UpnpSubscribeAsync, generating a callback when the operation is complete.

## Documentation

> UpnpUnSubscribeAsync removes a subscription of a control point from a service previously subscribed to using UpnpSubscribe or UpnpSubscribeAsync, generating a callback when the operation is complete.

> Note that many of the error codes for this function are returned in the Upnp_Event_Subscribe structure. In those cases, the function returns `UPNP_E_SUCCESS` and the appropriate error code will be in the Upnp_Event_Subscribe.ErrCode field in the Event structure passed to the callback.

Parameters:
  Hnd - The handle of the subscribed control point.
  SubsId - The ID returned when the control point subscribed to the service.
  Fun - Pointer to a callback function to be called when the operation is complete.
  Cookie - Pointer to user data to pass to the callback function when invoked.
Returns:
  [int] An integer representing one of the following:
  - `UPNP_E_SUCCESS`: The operation completed successfully.
  - `UPNP_E_INVALID_HANDLE`: The handle is not a valid control point handle.
  - `UPNP_E_INVALID_SID`: The SubsId is not a valid SID.
  - `UPNP_E_INVALID_PARAM`: Fun is not a valid callback function pointer.
  - `UPNP_E_OUTOF_MEMORY`: Insufficient resources exist to complete this operation.
  - `UPNP_E_NETWORK_ERROR`: A network error occured (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_SOCKET_WRITE`: An error or timeout occurred writing to a socket (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_SOCKET_READ`: An error or timeout occurred reading from a socket (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_SOCKET_BIND`: An error occurred binding the socket (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_SOCKET_CONNECT`: An error occurred connecting to PublisherUrl (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_OUTOF_SOCKET`: An error occurred creating a socket ( returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_BAD_RESPONSE`: An error occurred in response from the publisher (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).
  - `UPNP_E_UNSUBSCRIBE_UNACCEPTED`: The publisher refused the subscription request (returned in the Upnp_Event_Subscribe.ErrCode field as part of the callback).

Alphabetic index

This page was generated with the help of DOC++.