class_websocketpeer.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/modules/websocket/doc_classes/WebSocketPeer.xml.
  6. .. _class_WebSocketPeer:
  7. WebSocketPeer
  8. =============
  9. **Inherits:** :ref:`PacketPeer<class_PacketPeer>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A WebSocket connection.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This class represents WebSocket connection, and can be used as a WebSocket client (RFC 6455-compliant) or as a remote peer of a WebSocket server.
  15. You can send WebSocket binary frames using :ref:`PacketPeer.put_packet<class_PacketPeer_method_put_packet>`, and WebSocket text frames using :ref:`send<class_WebSocketPeer_method_send>` (prefer text frames when interacting with text-based API). You can check the frame type of the last packet via :ref:`was_string_packet<class_WebSocketPeer_method_was_string_packet>`.
  16. To start a WebSocket client, first call :ref:`connect_to_url<class_WebSocketPeer_method_connect_to_url>`, then regularly call :ref:`poll<class_WebSocketPeer_method_poll>` (e.g. during :ref:`Node<class_Node>` process). You can query the socket state via :ref:`get_ready_state<class_WebSocketPeer_method_get_ready_state>`, get the number of pending packets using :ref:`PacketPeer.get_available_packet_count<class_PacketPeer_method_get_available_packet_count>`, and retrieve them via :ref:`PacketPeer.get_packet<class_PacketPeer_method_get_packet>`.
  17. .. tabs::
  18. .. code-tab:: gdscript
  19. extends Node
  20. var socket = WebSocketPeer.new()
  21. func _ready():
  22. socket.connect_to_url("wss://example.com")
  23. func _process(delta):
  24. socket.poll()
  25. var state = socket.get_ready_state()
  26. if state == WebSocketPeer.STATE_OPEN:
  27. while socket.get_available_packet_count():
  28. print("Packet: ", socket.get_packet())
  29. elif state == WebSocketPeer.STATE_CLOSING:
  30. # Keep polling to achieve proper close.
  31. pass
  32. elif state == WebSocketPeer.STATE_CLOSED:
  33. var code = socket.get_close_code()
  34. var reason = socket.get_close_reason()
  35. print("WebSocket closed with code: %d, reason %s. Clean: %s" % [code, reason, code != -1])
  36. set_process(false) # Stop processing.
  37. To use the peer as part of a WebSocket server refer to :ref:`accept_stream<class_WebSocketPeer_method_accept_stream>` and the online tutorial.
  38. .. rst-class:: classref-reftable-group
  39. Properties
  40. ----------
  41. .. table::
  42. :widths: auto
  43. +---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
  44. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`handshake_headers<class_WebSocketPeer_property_handshake_headers>` | ``PackedStringArray()`` |
  45. +---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
  46. | :ref:`int<class_int>` | :ref:`inbound_buffer_size<class_WebSocketPeer_property_inbound_buffer_size>` | ``65535`` |
  47. +---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
  48. | :ref:`int<class_int>` | :ref:`max_queued_packets<class_WebSocketPeer_property_max_queued_packets>` | ``2048`` |
  49. +---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
  50. | :ref:`int<class_int>` | :ref:`outbound_buffer_size<class_WebSocketPeer_property_outbound_buffer_size>` | ``65535`` |
  51. +---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
  52. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`supported_protocols<class_WebSocketPeer_property_supported_protocols>` | ``PackedStringArray()`` |
  53. +---------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
  54. .. rst-class:: classref-reftable-group
  55. Methods
  56. -------
  57. .. table::
  58. :widths: auto
  59. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`accept_stream<class_WebSocketPeer_method_accept_stream>` **(** :ref:`StreamPeer<class_StreamPeer>` stream **)** |
  61. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`close<class_WebSocketPeer_method_close>` **(** :ref:`int<class_int>` code=1000, :ref:`String<class_String>` reason="" **)** |
  63. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_to_url<class_WebSocketPeer_method_connect_to_url>` **(** :ref:`String<class_String>` url, :ref:`TLSOptions<class_TLSOptions>` tls_client_options=null **)** |
  65. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_close_code<class_WebSocketPeer_method_get_close_code>` **(** **)** |const| |
  67. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`String<class_String>` | :ref:`get_close_reason<class_WebSocketPeer_method_get_close_reason>` **(** **)** |const| |
  69. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`String<class_String>` | :ref:`get_connected_host<class_WebSocketPeer_method_get_connected_host>` **(** **)** |const| |
  71. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`int<class_int>` | :ref:`get_connected_port<class_WebSocketPeer_method_get_connected_port>` **(** **)** |const| |
  73. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_current_outbound_buffered_amount<class_WebSocketPeer_method_get_current_outbound_buffered_amount>` **(** **)** |const| |
  75. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`State<enum_WebSocketPeer_State>` | :ref:`get_ready_state<class_WebSocketPeer_method_get_ready_state>` **(** **)** |const| |
  77. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`String<class_String>` | :ref:`get_requested_url<class_WebSocketPeer_method_get_requested_url>` **(** **)** |const| |
  79. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`String<class_String>` | :ref:`get_selected_protocol<class_WebSocketPeer_method_get_selected_protocol>` **(** **)** |const| |
  81. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`poll<class_WebSocketPeer_method_poll>` **(** **)** |
  83. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`send<class_WebSocketPeer_method_send>` **(** :ref:`PackedByteArray<class_PackedByteArray>` message, :ref:`WriteMode<enum_WebSocketPeer_WriteMode>` write_mode=1 **)** |
  85. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`send_text<class_WebSocketPeer_method_send_text>` **(** :ref:`String<class_String>` message **)** |
  87. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`set_no_delay<class_WebSocketPeer_method_set_no_delay>` **(** :ref:`bool<class_bool>` enabled **)** |
  89. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`was_string_packet<class_WebSocketPeer_method_was_string_packet>` **(** **)** |const| |
  91. +----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. .. rst-class:: classref-section-separator
  93. ----
  94. .. rst-class:: classref-descriptions-group
  95. Enumerations
  96. ------------
  97. .. _enum_WebSocketPeer_WriteMode:
  98. .. rst-class:: classref-enumeration
  99. enum **WriteMode**:
  100. .. _class_WebSocketPeer_constant_WRITE_MODE_TEXT:
  101. .. rst-class:: classref-enumeration-constant
  102. :ref:`WriteMode<enum_WebSocketPeer_WriteMode>` **WRITE_MODE_TEXT** = ``0``
  103. Specifies that WebSockets messages should be transferred as text payload (only valid UTF-8 is allowed).
  104. .. _class_WebSocketPeer_constant_WRITE_MODE_BINARY:
  105. .. rst-class:: classref-enumeration-constant
  106. :ref:`WriteMode<enum_WebSocketPeer_WriteMode>` **WRITE_MODE_BINARY** = ``1``
  107. Specifies that WebSockets messages should be transferred as binary payload (any byte combination is allowed).
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _enum_WebSocketPeer_State:
  111. .. rst-class:: classref-enumeration
  112. enum **State**:
  113. .. _class_WebSocketPeer_constant_STATE_CONNECTING:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`State<enum_WebSocketPeer_State>` **STATE_CONNECTING** = ``0``
  116. Socket has been created. The connection is not yet open.
  117. .. _class_WebSocketPeer_constant_STATE_OPEN:
  118. .. rst-class:: classref-enumeration-constant
  119. :ref:`State<enum_WebSocketPeer_State>` **STATE_OPEN** = ``1``
  120. The connection is open and ready to communicate.
  121. .. _class_WebSocketPeer_constant_STATE_CLOSING:
  122. .. rst-class:: classref-enumeration-constant
  123. :ref:`State<enum_WebSocketPeer_State>` **STATE_CLOSING** = ``2``
  124. The connection is in the process of closing. This means a close request has been sent to the remote peer but confirmation has not been received.
  125. .. _class_WebSocketPeer_constant_STATE_CLOSED:
  126. .. rst-class:: classref-enumeration-constant
  127. :ref:`State<enum_WebSocketPeer_State>` **STATE_CLOSED** = ``3``
  128. The connection is closed or couldn't be opened.
  129. .. rst-class:: classref-section-separator
  130. ----
  131. .. rst-class:: classref-descriptions-group
  132. Property Descriptions
  133. ---------------------
  134. .. _class_WebSocketPeer_property_handshake_headers:
  135. .. rst-class:: classref-property
  136. :ref:`PackedStringArray<class_PackedStringArray>` **handshake_headers** = ``PackedStringArray()``
  137. .. rst-class:: classref-property-setget
  138. - void **set_handshake_headers** **(** :ref:`PackedStringArray<class_PackedStringArray>` value **)**
  139. - :ref:`PackedStringArray<class_PackedStringArray>` **get_handshake_headers** **(** **)**
  140. The extra HTTP headers to be sent during the WebSocket handshake.
  141. \ **Note:** Not supported in Web exports due to browsers' restrictions.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_WebSocketPeer_property_inbound_buffer_size:
  145. .. rst-class:: classref-property
  146. :ref:`int<class_int>` **inbound_buffer_size** = ``65535``
  147. .. rst-class:: classref-property-setget
  148. - void **set_inbound_buffer_size** **(** :ref:`int<class_int>` value **)**
  149. - :ref:`int<class_int>` **get_inbound_buffer_size** **(** **)**
  150. The size of the input buffer in bytes (roughly the maximum amount of memory that will be allocated for the inbound packets).
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_WebSocketPeer_property_max_queued_packets:
  154. .. rst-class:: classref-property
  155. :ref:`int<class_int>` **max_queued_packets** = ``2048``
  156. .. rst-class:: classref-property-setget
  157. - void **set_max_queued_packets** **(** :ref:`int<class_int>` value **)**
  158. - :ref:`int<class_int>` **get_max_queued_packets** **(** **)**
  159. The maximum amount of packets that will be allowed in the queues (both inbound and outbound).
  160. .. rst-class:: classref-item-separator
  161. ----
  162. .. _class_WebSocketPeer_property_outbound_buffer_size:
  163. .. rst-class:: classref-property
  164. :ref:`int<class_int>` **outbound_buffer_size** = ``65535``
  165. .. rst-class:: classref-property-setget
  166. - void **set_outbound_buffer_size** **(** :ref:`int<class_int>` value **)**
  167. - :ref:`int<class_int>` **get_outbound_buffer_size** **(** **)**
  168. The size of the input buffer in bytes (roughly the maximum amount of memory that will be allocated for the outbound packets).
  169. .. rst-class:: classref-item-separator
  170. ----
  171. .. _class_WebSocketPeer_property_supported_protocols:
  172. .. rst-class:: classref-property
  173. :ref:`PackedStringArray<class_PackedStringArray>` **supported_protocols** = ``PackedStringArray()``
  174. .. rst-class:: classref-property-setget
  175. - void **set_supported_protocols** **(** :ref:`PackedStringArray<class_PackedStringArray>` value **)**
  176. - :ref:`PackedStringArray<class_PackedStringArray>` **get_supported_protocols** **(** **)**
  177. The WebSocket sub-protocols allowed during the WebSocket handshake.
  178. .. rst-class:: classref-section-separator
  179. ----
  180. .. rst-class:: classref-descriptions-group
  181. Method Descriptions
  182. -------------------
  183. .. _class_WebSocketPeer_method_accept_stream:
  184. .. rst-class:: classref-method
  185. :ref:`Error<enum_@GlobalScope_Error>` **accept_stream** **(** :ref:`StreamPeer<class_StreamPeer>` stream **)**
  186. Accepts a peer connection performing the HTTP handshake as a WebSocket server. The ``stream`` must be a valid TCP stream retrieved via :ref:`TCPServer.take_connection<class_TCPServer_method_take_connection>`, or a TLS stream accepted via :ref:`StreamPeerTLS.accept_stream<class_StreamPeerTLS_method_accept_stream>`.
  187. \ **Note:** Not supported in Web exports due to browsers' restrictions.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_WebSocketPeer_method_close:
  191. .. rst-class:: classref-method
  192. void **close** **(** :ref:`int<class_int>` code=1000, :ref:`String<class_String>` reason="" **)**
  193. Closes this WebSocket connection. ``code`` is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). ``reason`` is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes). If ``code`` is negative, the connection will be closed immediately without notifying the remote peer.
  194. \ **Note:** To achieve a clean close, you will need to keep polling until :ref:`STATE_CLOSED<class_WebSocketPeer_constant_STATE_CLOSED>` is reached.
  195. \ **Note:** The Web export might not support all status codes. Please refer to browser-specific documentation for more details.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_WebSocketPeer_method_connect_to_url:
  199. .. rst-class:: classref-method
  200. :ref:`Error<enum_@GlobalScope_Error>` **connect_to_url** **(** :ref:`String<class_String>` url, :ref:`TLSOptions<class_TLSOptions>` tls_client_options=null **)**
  201. Connects to the given URL. TLS certificates will be verified against the hostname when connecting using the ``wss://`` protocol. You can pass the optional ``tls_client_options`` parameter to customize the trusted certification authorities, or disable the common name verification. See :ref:`TLSOptions.client<class_TLSOptions_method_client>` and :ref:`TLSOptions.client_unsafe<class_TLSOptions_method_client_unsafe>`.
  202. \ **Note:** To avoid mixed content warnings or errors in Web, you may have to use a ``url`` that starts with ``wss://`` (secure) instead of ``ws://``. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's TLS certificate. Do not connect directly via the IP address for ``wss://`` connections, as it won't match with the TLS certificate.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_WebSocketPeer_method_get_close_code:
  206. .. rst-class:: classref-method
  207. :ref:`int<class_int>` **get_close_code** **(** **)** |const|
  208. Returns the received WebSocket close frame status code, or ``-1`` when the connection was not cleanly closed. Only call this method when :ref:`get_ready_state<class_WebSocketPeer_method_get_ready_state>` returns :ref:`STATE_CLOSED<class_WebSocketPeer_constant_STATE_CLOSED>`.
  209. .. rst-class:: classref-item-separator
  210. ----
  211. .. _class_WebSocketPeer_method_get_close_reason:
  212. .. rst-class:: classref-method
  213. :ref:`String<class_String>` **get_close_reason** **(** **)** |const|
  214. Returns the received WebSocket close frame status reason string. Only call this method when :ref:`get_ready_state<class_WebSocketPeer_method_get_ready_state>` returns :ref:`STATE_CLOSED<class_WebSocketPeer_constant_STATE_CLOSED>`.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_WebSocketPeer_method_get_connected_host:
  218. .. rst-class:: classref-method
  219. :ref:`String<class_String>` **get_connected_host** **(** **)** |const|
  220. Returns the IP address of the connected peer.
  221. \ **Note:** Not available in the Web export.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_WebSocketPeer_method_get_connected_port:
  225. .. rst-class:: classref-method
  226. :ref:`int<class_int>` **get_connected_port** **(** **)** |const|
  227. Returns the remote port of the connected peer.
  228. \ **Note:** Not available in the Web export.
  229. .. rst-class:: classref-item-separator
  230. ----
  231. .. _class_WebSocketPeer_method_get_current_outbound_buffered_amount:
  232. .. rst-class:: classref-method
  233. :ref:`int<class_int>` **get_current_outbound_buffered_amount** **(** **)** |const|
  234. Returns the current amount of data in the outbound websocket buffer. **Note:** Web exports use WebSocket.bufferedAmount, while other platforms use an internal buffer.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_WebSocketPeer_method_get_ready_state:
  238. .. rst-class:: classref-method
  239. :ref:`State<enum_WebSocketPeer_State>` **get_ready_state** **(** **)** |const|
  240. Returns the ready state of the connection. See :ref:`State<enum_WebSocketPeer_State>`.
  241. .. rst-class:: classref-item-separator
  242. ----
  243. .. _class_WebSocketPeer_method_get_requested_url:
  244. .. rst-class:: classref-method
  245. :ref:`String<class_String>` **get_requested_url** **(** **)** |const|
  246. Returns the URL requested by this peer. The URL is derived from the ``url`` passed to :ref:`connect_to_url<class_WebSocketPeer_method_connect_to_url>` or from the HTTP headers when acting as server (i.e. when using :ref:`accept_stream<class_WebSocketPeer_method_accept_stream>`).
  247. .. rst-class:: classref-item-separator
  248. ----
  249. .. _class_WebSocketPeer_method_get_selected_protocol:
  250. .. rst-class:: classref-method
  251. :ref:`String<class_String>` **get_selected_protocol** **(** **)** |const|
  252. Returns the selected WebSocket sub-protocol for this connection or an empty string if the sub-protocol has not been selected yet.
  253. .. rst-class:: classref-item-separator
  254. ----
  255. .. _class_WebSocketPeer_method_poll:
  256. .. rst-class:: classref-method
  257. void **poll** **(** **)**
  258. Updates the connection state and receive incoming packets. Call this function regularly to keep it in a clean state.
  259. .. rst-class:: classref-item-separator
  260. ----
  261. .. _class_WebSocketPeer_method_send:
  262. .. rst-class:: classref-method
  263. :ref:`Error<enum_@GlobalScope_Error>` **send** **(** :ref:`PackedByteArray<class_PackedByteArray>` message, :ref:`WriteMode<enum_WebSocketPeer_WriteMode>` write_mode=1 **)**
  264. Sends the given ``message`` using the desired ``write_mode``. When sending a :ref:`String<class_String>`, prefer using :ref:`send_text<class_WebSocketPeer_method_send_text>`.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_WebSocketPeer_method_send_text:
  268. .. rst-class:: classref-method
  269. :ref:`Error<enum_@GlobalScope_Error>` **send_text** **(** :ref:`String<class_String>` message **)**
  270. Sends the given ``message`` using WebSocket text mode. Prefer this method over :ref:`PacketPeer.put_packet<class_PacketPeer_method_put_packet>` when interacting with third-party text-based API (e.g. when using :ref:`JSON<class_JSON>` formatted messages).
  271. .. rst-class:: classref-item-separator
  272. ----
  273. .. _class_WebSocketPeer_method_set_no_delay:
  274. .. rst-class:: classref-method
  275. void **set_no_delay** **(** :ref:`bool<class_bool>` enabled **)**
  276. Disable Nagle's algorithm on the underling TCP socket (default). See :ref:`StreamPeerTCP.set_no_delay<class_StreamPeerTCP_method_set_no_delay>` for more information.
  277. \ **Note:** Not available in the Web export.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_WebSocketPeer_method_was_string_packet:
  281. .. rst-class:: classref-method
  282. :ref:`bool<class_bool>` **was_string_packet** **(** **)** |const|
  283. Returns ``true`` if the last received packet was sent as a text payload. See :ref:`WriteMode<enum_WebSocketPeer_WriteMode>`.
  284. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  285. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  286. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  287. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  288. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  289. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  290. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`