Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
disconnectFromHost
Disconnects from host.
StreamPeerTCP.swift:222final func disconnectFromHost()
Other members in extension
Types
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 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.