Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
GatheringState
WebRTCPeerConnection.swift:59enum GatheringState
Cases
case new
The peer connection was just created and hasn’t done any networking yet.
case gathering
The ICE agent is in the process of gathering candidates for the connection.
case complete
The ICE agent has finished gathering candidates. If something happens that requires collecting new candidates, such as a new interface being added or the addition of a new ICE server, the state will revert to gathering to gather those candidates.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (21) members.
Types
enum ConnectionState
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
enum SignalingState
Type members
static func setDefaultExtension(extensionClass: StringName
) Sets the
extensionClass
as the defaultWebRTCPeerConnectionExtension
returned when creating a newWebRTCPeerConnection
.class var godotClassName: StringName
Instance members
var dataChannelReceived: Signal3
Emitted when a new in-band channel is received, i.e. when the channel was created with
negotiated: false
(default).var iceCandidateCreated: Signal2
Emitted when a new ICE candidate has been created. The three parameters are meant to be passed to the remote peer over the signaling server.
var sessionDescriptionCreated: Signal1
Emitted after a successful call to
createOffer
orsetRemoteDescription(type:sdp:)
(when it generates an answer). The parameters are meant to be passed tosetLocalDescription(type:sdp:)
on this object, and sent to the remote peer over the signaling server.func addIceCandidate(media: String, index: Int32, name: String
) -> GodotError Add an ice candidate generated by a remote peer (and received over the signaling server). See [signal ice_candidate_created].
func close(
) Close the peer connection and all data channels associated with it.
func createDataChannel(label: String, options: GDictionary
) -> WebRTCDataChannel? Returns a new
WebRTCDataChannel
(ornull
on failure) with givenlabel
and optionally configured via theoptions
dictionary. This method can only be called when the connection is in state .stateNew.func createOffer(
) -> GodotError Creates a new SDP offer to start a WebRTC connection with a remote peer. At least one
WebRTCDataChannel
must have been created before calling this method.func getConnectionState(
) -> WebRTCPeerConnection.ConnectionState Returns the connection state. See
ConnectionState
.func getGatheringState(
) -> WebRTCPeerConnection.GatheringState Returns the ICE
GatheringState
of the connection. This lets you detect, for example, when collection of ICE candidates has finished.func getSignalingState(
) -> WebRTCPeerConnection.SignalingState Returns the
SignalingState
on the local end of the connection while connecting or reconnecting to another peer.func initialize(configuration: GDictionary
) -> GodotError Re-initialize this peer connection, closing any previously active connection, and going back to state .stateNew. A dictionary of
configuration
options can be passed to configure the peer connection.func poll(
) -> GodotError Call this method frequently (e.g. in
_process(delta:)
or_physicsProcess(delta:)
) to properly receive signals.func setLocalDescription(type: String, sdp: String
) -> GodotError Sets the SDP description of the local peer. This should be called in response to [signal session_description_created].
func setRemoteDescription(type: String, sdp: String
) -> GodotError Sets the SDP description of the remote peer. This should be called with the values generated by a remote peer and received over the signaling server.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.