Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
Status
StreamPeerTCP.swift:16enum Status
Cases
case none
The initial status of the
StreamPeerTCP
. This is also the status after disconnecting.case connecting
A status representing a
StreamPeerTCP
that is connecting to a host.case connected
A status representing a
StreamPeerTCP
that is connected to a host.case error
A status representing a
StreamPeerTCP
in error state.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (10) members.
Type members
Instance members
func bind(port: Int32, host: String
) -> GodotError Opens the TCP socket, and binds it to the specified local address.
func connectToHost(String, port: Int32
) -> GodotError Connects to the specified
host:port
pair. A hostname will be resolved if valid. Returnsok
on success.func disconnectFromHost(
) Disconnects from host.
func getConnectedHost(
) -> String Returns the IP of this peer.
func getConnectedPort(
) -> Int32 Returns the port of this peer.
func getLocalPort(
) -> Int32 Returns the local port to which this peer is bound.
func getStatus(
) -> StreamPeerTCP.Status Returns the status of the connection, see
Status
.func poll(
) -> GodotError Poll the socket, updating its state. See
getStatus
.func setNoDelay(enabled: Bool
) If
enabled
istrue
, packets will be sent immediately. Ifenabled
isfalse
(the default), packet transfers will be delayed and combined using Nagle’s algorithm.
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.