WebRTCDataChannel
WebRTCDataChannel.swift:8class WebRTCDataChannel
Superclasses
class PacketPeer
Abstraction and base class for packet-based protocols.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
Type members
Instance members
var writeMode: WebRTCDataChannel.WriteMode
The transfer mode to use when sending outgoing packet. Either text or binary.
func close(
) Closes this data channel, notifying the other peer.
func getBufferedAmount(
) -> Int32 Returns the number of bytes currently queued to be sent over this channel.
func getId(
) -> Int32 Returns the ID assigned to this channel during creation (or auto-assigned during negotiation).
func getLabel(
) -> String Returns the label assigned to this channel during creation.
func getMaxPacketLifeTime(
) -> Int32 Returns the
maxPacketLifeTime
value assigned to this channel during creation.func getMaxRetransmits(
) -> Int32 Returns the
maxRetransmits
value assigned to this channel during creation.func getProtocol(
) -> String Returns the sub-protocol assigned to this channel during creation. An empty string if not specified.
func getReadyState(
) -> WebRTCDataChannel.ChannelState Returns the current state of this channel, see
ChannelState
.func isNegotiated(
) -> Bool Returns
true
if this channel was created with out-of-band configuration.func isOrdered(
) -> Bool Returns
true
if this channel was created with ordering enabled (default).func poll(
) -> GodotError Reserved, but not used for now.
func wasStringPacket(
) -> Bool Returns
true
if the last received packet was transferred as text. SeewriteMode
.