class_ip.rst 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. | :ref:`String<class_string>` | :ref:`resolve_hostname<class_IP_resolve_hostname>` **(** :ref:`String<class_string>` host **)** |
  16. +------------------------------+-------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`resolve_hostname_queue_item<class_IP_resolve_hostname_queue_item>` **(** :ref:`String<class_string>` host **)** |
  18. +------------------------------+-------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_resolve_item_status<class_IP_get_resolve_item_status>` **(** :ref:`int<class_int>` id **)** 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. | void | :ref:`erase_resolve_item<class_IP_erase_resolve_item>` **(** :ref:`int<class_int>` id **)** |
  24. +------------------------------+-------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Array<class_array>` | :ref:`get_local_addresses<class_IP_get_local_addresses>` **(** **)** const |
  26. +------------------------------+-------------------------------------------------------------------------------------------------------------------------+
  27. Numeric Constants
  28. -----------------
  29. - **RESOLVER_STATUS_NONE** = **0**
  30. - **RESOLVER_STATUS_WAITING** = **1**
  31. - **RESOLVER_STATUS_DONE** = **2**
  32. - **RESOLVER_STATUS_ERROR** = **3**
  33. - **RESOLVER_MAX_QUERIES** = **32**
  34. - **RESOLVER_INVALID_ID** = **-1**
  35. Description
  36. -----------
  37. 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.
  38. Member Function Description
  39. ---------------------------
  40. .. _class_IP_resolve_hostname:
  41. - :ref:`String<class_string>` **resolve_hostname** **(** :ref:`String<class_string>` host **)**
  42. Resolve a given hostname, blocking. Resolved hostname is returned as an IP.
  43. .. _class_IP_resolve_hostname_queue_item:
  44. - :ref:`int<class_int>` **resolve_hostname_queue_item** **(** :ref:`String<class_string>` host **)**
  45. Create a queue item for resolving a given hostname. The queue ID is returned, or RESOLVER_INVALID_ID on error.
  46. .. _class_IP_get_resolve_item_status:
  47. - :ref:`int<class_int>` **get_resolve_item_status** **(** :ref:`int<class_int>` id **)** const
  48. Return the status of hostname queued for resolving, given it's queue ID. Returned status can be any of the RESOLVER_STATUS\_\* enumeration.
  49. .. _class_IP_get_resolve_item_address:
  50. - :ref:`String<class_string>` **get_resolve_item_address** **(** :ref:`int<class_int>` id **)** const
  51. 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>`).
  52. .. _class_IP_erase_resolve_item:
  53. - void **erase_resolve_item** **(** :ref:`int<class_int>` id **)**
  54. 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.
  55. .. _class_IP_get_local_addresses:
  56. - :ref:`Array<class_array>` **get_local_addresses** **(** **)** const