WebRTCDataChannel
继承: PacketPeer
< RefCounted
< Object
派生: WebRTCDataChannelExtension
该类目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
属性
方法
void | close ( ) |
int | get_buffered_amount ( ) const1 |
int | get_id ( ) const1 |
String | get_label ( ) const1 |
int | get_max_packet_life_time ( ) const1 |
int | get_max_retransmits ( ) const1 |
String | get_protocol ( ) const1 |
ChannelState | get_ready_state ( ) const1 |
bool | is_negotiated ( ) const1 |
bool | is_ordered ( ) const1 |
Error | poll ( ) |
bool | was_string_packet ( ) const1 |
枚举
enum WriteMode:
WriteMode WRITE_MODE_TEXT = 0
Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string.
WriteMode WRITE_MODE_BINARY = 1
Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob.
enum ChannelState:
ChannelState STATE_CONNECTING = 0
The channel was created, but it's still trying to connect.
ChannelState STATE_OPEN = 1
The channel is currently open, and data can flow over it.
ChannelState STATE_CLOSING = 2
The channel is being closed, no new messages will be accepted, but those already in queue will be flushed.
ChannelState STATE_CLOSED = 3
The channel was closed, or connection failed.
属性说明
WriteMode write_mode = 1
The transfer mode to use when sending outgoing packet. Either text or binary.
方法说明
void
close ( )
Closes this data channel, notifying the other peer.
int
get_buffered_amount ( ) const1
Returns the number of bytes currently queued to be sent over this channel.
Returns the ID assigned to this channel during creation (or auto-assigned during negotiation).
If the channel is not negotiated out-of-band the ID will only be available after the connection is established (will return 65535
until then).
Returns the label assigned to this channel during creation.
int
get_max_packet_life_time ( ) const1
Returns the maxPacketLifeTime
value assigned to this channel during creation.
Will be 65535
if not specified.
int
get_max_retransmits ( ) const1
Returns the maxRetransmits
value assigned to this channel during creation.
Will be 65535
if not specified.
String
get_protocol ( ) const1
Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
ChannelState get_ready_state ( ) const1
Returns the current state of this channel, see ChannelState.
Returns true
if this channel was created with out-of-band configuration.
Returns true
if this channel was created with ordering enabled (default).
Error poll ( )
Reserved, but not used for now.
bool
was_string_packet ( ) const1
Returns true
if the last received packet was transferred as text. See write_mode
.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。