123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the UPNPDevice.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_UPNPDevice:
- UPNPDevice
- ==========
- **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- UPNP device.
- Description
- -----------
- UPNP device. See :ref:`UPNP<class_UPNP>` for UPNP discovery and utility functions. Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) and to query network information of the device (like local and external IP address and status). Note that methods on this class are synchronous and block the calling thread.
- Properties
- ----------
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- | :ref:`String<class_String>` | :ref:`description_url<class_UPNPDevice_property_description_url>` | ``""`` |
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- | :ref:`String<class_String>` | :ref:`igd_control_url<class_UPNPDevice_property_igd_control_url>` | ``""`` |
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- | :ref:`String<class_String>` | :ref:`igd_our_addr<class_UPNPDevice_property_igd_our_addr>` | ``""`` |
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- | :ref:`String<class_String>` | :ref:`igd_service_type<class_UPNPDevice_property_igd_service_type>` | ``""`` |
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- | :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` | :ref:`igd_status<class_UPNPDevice_property_igd_status>` | ``9`` |
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- | :ref:`String<class_String>` | :ref:`service_type<class_UPNPDevice_property_service_type>` | ``""`` |
- +---------------------------------------------+---------------------------------------------------------------------+--------+
- Methods
- -------
- +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`add_port_mapping<class_UPNPDevice_method_add_port_mapping>` **(** :ref:`int<class_int>` port, :ref:`int<class_int>` port_internal=0, :ref:`String<class_String>` desc="", :ref:`String<class_String>` proto="UDP", :ref:`int<class_int>` duration=0 **)** |const| |
- +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`delete_port_mapping<class_UPNPDevice_method_delete_port_mapping>` **(** :ref:`int<class_int>` port, :ref:`String<class_String>` proto="UDP" **)** |const| |
- +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_valid_gateway<class_UPNPDevice_method_is_valid_gateway>` **(** **)** |const| |
- +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`query_external_address<class_UPNPDevice_method_query_external_address>` **(** **)** |const| |
- +-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Enumerations
- ------------
- .. _enum_UPNPDevice_IGDStatus:
- .. _class_UPNPDevice_constant_IGD_STATUS_OK:
- .. _class_UPNPDevice_constant_IGD_STATUS_HTTP_ERROR:
- .. _class_UPNPDevice_constant_IGD_STATUS_HTTP_EMPTY:
- .. _class_UPNPDevice_constant_IGD_STATUS_NO_URLS:
- .. _class_UPNPDevice_constant_IGD_STATUS_NO_IGD:
- .. _class_UPNPDevice_constant_IGD_STATUS_DISCONNECTED:
- .. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_DEVICE:
- .. _class_UPNPDevice_constant_IGD_STATUS_INVALID_CONTROL:
- .. _class_UPNPDevice_constant_IGD_STATUS_MALLOC_ERROR:
- .. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_ERROR:
- enum **IGDStatus**:
- - **IGD_STATUS_OK** = **0** --- OK.
- - **IGD_STATUS_HTTP_ERROR** = **1** --- HTTP error.
- - **IGD_STATUS_HTTP_EMPTY** = **2** --- Empty HTTP response.
- - **IGD_STATUS_NO_URLS** = **3** --- Returned response contained no URLs.
- - **IGD_STATUS_NO_IGD** = **4** --- Not a valid IGD.
- - **IGD_STATUS_DISCONNECTED** = **5** --- Disconnected.
- - **IGD_STATUS_UNKNOWN_DEVICE** = **6** --- Unknown device.
- - **IGD_STATUS_INVALID_CONTROL** = **7** --- Invalid control.
- - **IGD_STATUS_MALLOC_ERROR** = **8** --- Memory allocation error.
- - **IGD_STATUS_UNKNOWN_ERROR** = **9** --- Unknown error.
- Property Descriptions
- ---------------------
- .. _class_UPNPDevice_property_description_url:
- - :ref:`String<class_String>` **description_url**
- +-----------+----------------------------+
- | *Default* | ``""`` |
- +-----------+----------------------------+
- | *Setter* | set_description_url(value) |
- +-----------+----------------------------+
- | *Getter* | get_description_url() |
- +-----------+----------------------------+
- URL to the device description.
- ----
- .. _class_UPNPDevice_property_igd_control_url:
- - :ref:`String<class_String>` **igd_control_url**
- +-----------+----------------------------+
- | *Default* | ``""`` |
- +-----------+----------------------------+
- | *Setter* | set_igd_control_url(value) |
- +-----------+----------------------------+
- | *Getter* | get_igd_control_url() |
- +-----------+----------------------------+
- IDG control URL.
- ----
- .. _class_UPNPDevice_property_igd_our_addr:
- - :ref:`String<class_String>` **igd_our_addr**
- +-----------+-------------------------+
- | *Default* | ``""`` |
- +-----------+-------------------------+
- | *Setter* | set_igd_our_addr(value) |
- +-----------+-------------------------+
- | *Getter* | get_igd_our_addr() |
- +-----------+-------------------------+
- Address of the local machine in the network connecting it to this ``UPNPDevice``.
- ----
- .. _class_UPNPDevice_property_igd_service_type:
- - :ref:`String<class_String>` **igd_service_type**
- +-----------+-----------------------------+
- | *Default* | ``""`` |
- +-----------+-----------------------------+
- | *Setter* | set_igd_service_type(value) |
- +-----------+-----------------------------+
- | *Getter* | get_igd_service_type() |
- +-----------+-----------------------------+
- IGD service type.
- ----
- .. _class_UPNPDevice_property_igd_status:
- - :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>` **igd_status**
- +-----------+-----------------------+
- | *Default* | ``9`` |
- +-----------+-----------------------+
- | *Setter* | set_igd_status(value) |
- +-----------+-----------------------+
- | *Getter* | get_igd_status() |
- +-----------+-----------------------+
- IGD status. See :ref:`IGDStatus<enum_UPNPDevice_IGDStatus>`.
- ----
- .. _class_UPNPDevice_property_service_type:
- - :ref:`String<class_String>` **service_type**
- +-----------+-------------------------+
- | *Default* | ``""`` |
- +-----------+-------------------------+
- | *Setter* | set_service_type(value) |
- +-----------+-------------------------+
- | *Getter* | get_service_type() |
- +-----------+-------------------------+
- Service type.
- Method Descriptions
- -------------------
- .. _class_UPNPDevice_method_add_port_mapping:
- - :ref:`int<class_int>` **add_port_mapping** **(** :ref:`int<class_int>` port, :ref:`int<class_int>` port_internal=0, :ref:`String<class_String>` desc="", :ref:`String<class_String>` proto="UDP", :ref:`int<class_int>` duration=0 **)** |const|
- Adds a port mapping to forward the given external port on this ``UPNPDevice`` for the given protocol to the local machine. See :ref:`UPNP.add_port_mapping<class_UPNP_method_add_port_mapping>`.
- ----
- .. _class_UPNPDevice_method_delete_port_mapping:
- - :ref:`int<class_int>` **delete_port_mapping** **(** :ref:`int<class_int>` port, :ref:`String<class_String>` proto="UDP" **)** |const|
- Deletes the port mapping identified by the given port and protocol combination on this device. See :ref:`UPNP.delete_port_mapping<class_UPNP_method_delete_port_mapping>`.
- ----
- .. _class_UPNPDevice_method_is_valid_gateway:
- - :ref:`bool<class_bool>` **is_valid_gateway** **(** **)** |const|
- Returns ``true`` if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding.
- ----
- .. _class_UPNPDevice_method_query_external_address:
- - :ref:`String<class_String>` **query_external_address** **(** **)** |const|
- Returns the external IP address of this ``UPNPDevice`` or an empty string.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|