## EXPORT_SPEC int UpnpInit

## ( IN const char* HostIP,
IN unsigned short DestPort )

> Initializes the Linux SDK for UPnP Devices.

## Documentation

> Initializes the Linux SDK for UPnP Devices. This function must be called before any other API function can be called. It should be called only once. Subsequent calls to this API return a `UPNP_E_INIT` error code.

> Optionally, the application can specify a host IP address (in the case of a multi-homed configuration) and a port number to use for all UPnP operations. Since a port number can be used only by one process, multiple processes using the SDK must specify different port numbers.

> If unspecified, the SDK will use the first adapter's IP address and an arbitrary port.

> This call is synchronous.

Parameters:
  HostIP - The host IP address to use, in string format, for example "192.168.0.1", or `NULL` to use the first adapter's IP address.
  DestPort - The destination port number to use. 0 will pick an arbitrary free port.
Returns:
  [int] An integer representing one of the following:
  - `UPNP_E_SUCCESS`: The operation completed successfully.
  - `UPNP_E_OUTOF_MEMORY`: Insufficient resources exist to initialize the SDK.
  - `UPNP_E_INIT`: The SDK is already initialized.
  - `UPNP_E_INIT_FAILED`: The SDK initialization failed for an unknown reason.
  - `UPNP_E_SOCKET_BIND`: An error occurred binding a socket.
  - `UPNP_E_LISTEN`: An error occurred listening to a socket.
  - `UPNP_E_OUTOF_SOCKET`: An error ocurred creating a socket.
  - `UPNP_E_INTERNAL_ERROR`: An internal error ocurred.

Alphabetic index

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