Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
WebRTCDataChannel
繼承: PacketPeer < RefCounted < Object
被繼承: WebRTCDataChannelExtension
There is currently no description for this class. Please help us by contributing one!
屬性
|
方法
void |
close() |
get_buffered_amount() const |
|
get_id() const |
|
get_label() const |
|
get_max_packet_life_time() const |
|
get_max_retransmits() const |
|
get_protocol() const |
|
get_ready_state() const |
|
is_negotiated() const |
|
is_ordered() const |
|
poll() |
|
was_string_packet() const |
列舉
enum WriteMode: 🔗
WriteMode WRITE_MODE_TEXT = 0
告訴通道以文字形式在這個通道上發送資料。外部對等體(非 Godot)會以字串的形式接收。
WriteMode WRITE_MODE_BINARY = 1
告訴通道以二進位形式在此通道上發送資料。外部對等體(非 Godot)將以陣列緩衝區或 blob 的形式接收。
enum ChannelState: 🔗
ChannelState STATE_CONNECTING = 0
通道已經建立,但它仍在嘗試連接。
ChannelState STATE_OPEN = 1
該通道目前是打開的,資料可以在其上流動。
ChannelState STATE_CLOSING = 2
通道正在關閉,將不接受新的消息,但已經在佇列中的消息將被更新。
ChannelState STATE_CLOSED = 3
通道已關閉,或連接失敗。
屬性說明
發送出去封包時要使用的傳輸模式。可以是文字或二進位。
方法說明
void close() 🔗
關閉此資料通道,通知另一個對等體。
int get_buffered_amount() const 🔗
返回目前排隊在此通道上發送的位元組數。
返回建立時分配給該通道的 ID(或是在協商時自動分配的)。
如果該通道沒有進行帶外協商,那麼該 ID 將只在連接建立後可用(在此之前將返回 65535)。
返回建立時分配給該通道的標籤。
int get_max_packet_life_time() const 🔗
返回建立時分配給這個通道的 maxPacketLifeTime 值。
如果沒有指定,將是 65535。
int get_max_retransmits() const 🔗
返回建立時分配給這個通道的 maxRetransmits 值。
如果沒有指定,將是 65535。
返回建立時分配給這個通道的子協議。如果沒有指定,則為空字串。
ChannelState get_ready_state() const 🔗
Returns the current state of this channel.
如果這個通道是用帶外配置建立的,返回 true。
如果這個通道在建立時啟用了排序功能,則預設返回 true。
保留,目前未使用。
bool was_string_packet() const 🔗
如果最後收到的封包是以文字形式傳輸,則返回 true。見 write_mode。