class_ip.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_IP:
  4. IP
  5. ==
  6. **Inherits:** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`IP_Unix<class_ip_unix>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. IP Protocol support functions.
  12. Member Functions
  13. ----------------
  14. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`clear_cache<class_IP_clear_cache>` **(** :ref:`String<class_string>` arg0="" **)** |
  16. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`erase_resolve_item<class_IP_erase_resolve_item>` **(** :ref:`int<class_int>` id **)** |
  18. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Array<class_array>` | :ref:`get_local_addresses<class_IP_get_local_addresses>` **(** **)** const |
  20. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_string>` | :ref:`get_resolve_item_address<class_IP_get_resolve_item_address>` **(** :ref:`int<class_int>` id **)** const |
  22. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_resolve_item_status<class_IP_get_resolve_item_status>` **(** :ref:`int<class_int>` id **)** const |
  24. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_string>` | :ref:`resolve_hostname<class_IP_resolve_hostname>` **(** :ref:`String<class_string>` host, :ref:`int<class_int>` ip_type=3 **)** |
  26. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`resolve_hostname_queue_item<class_IP_resolve_hostname_queue_item>` **(** :ref:`String<class_string>` host, :ref:`int<class_int>` ip_type=3 **)** |
  28. +------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. Numeric Constants
  30. -----------------
  31. - **RESOLVER_STATUS_NONE** = **0**
  32. - **RESOLVER_STATUS_WAITING** = **1**
  33. - **RESOLVER_STATUS_DONE** = **2**
  34. - **RESOLVER_STATUS_ERROR** = **3**
  35. - **RESOLVER_MAX_QUERIES** = **32**
  36. - **RESOLVER_INVALID_ID** = **-1**
  37. - **TYPE_NONE** = **0**
  38. - **TYPE_IPV4** = **1**
  39. - **TYPE_IPV6** = **2**
  40. - **TYPE_ANY** = **3**
  41. Description
  42. -----------
  43. IP contains some support functions for the IPv4 protocol. TCP/IP support is in different classes (see :ref:`StreamPeerTCP<class_streampeertcp>` and :ref:`TCP_Server<class_tcp_server>`). IP provides hostname resolution support, both blocking and threaded.
  44. Member Function Description
  45. ---------------------------
  46. .. _class_IP_clear_cache:
  47. - void **clear_cache** **(** :ref:`String<class_string>` arg0="" **)**
  48. .. _class_IP_erase_resolve_item:
  49. - void **erase_resolve_item** **(** :ref:`int<class_int>` id **)**
  50. Erase a queue ID, removing it from the queue if needed. This should be used after a queue is completed to free it and enable more queries to happen.
  51. .. _class_IP_get_local_addresses:
  52. - :ref:`Array<class_array>` **get_local_addresses** **(** **)** const
  53. .. _class_IP_get_resolve_item_address:
  54. - :ref:`String<class_string>` **get_resolve_item_address** **(** :ref:`int<class_int>` id **)** const
  55. Return a resolved item address, or an empty string if an error happened or resolution didn't happen yet (see :ref:`get_resolve_item_status<class_IP_get_resolve_item_status>`).
  56. .. _class_IP_get_resolve_item_status:
  57. - :ref:`int<class_int>` **get_resolve_item_status** **(** :ref:`int<class_int>` id **)** const
  58. Return the status of hostname queued for resolving, given its queue ID. Returned status can be any of the RESOLVER_STATUS\_\* enumeration.
  59. .. _class_IP_resolve_hostname:
  60. - :ref:`String<class_string>` **resolve_hostname** **(** :ref:`String<class_string>` host, :ref:`int<class_int>` ip_type=3 **)**
  61. Resolve a given hostname, blocking. Resolved hostname is returned as an IPv4 or IPv6 depending on "ip_type".
  62. .. _class_IP_resolve_hostname_queue_item:
  63. - :ref:`int<class_int>` **resolve_hostname_queue_item** **(** :ref:`String<class_string>` host, :ref:`int<class_int>` ip_type=3 **)**
  64. Create a queue item for resolving a given hostname to an IPv4 or IPv6 depending on "ip_type". The queue ID is returned, or RESOLVER_INVALID_ID on error.