TCPBase
public class TCPBase : CallbackQueueProtocol
Abstract base class for connections and listeners
-
Undocumented
See moreDeclaration
Swift
public enum State : Equatable
-
Undocumented
Declaration
Swift
public var state: State { get set }
-
Handler that will be called on state changes
Declaration
Swift
public var stateUpdateHandler: ((State) -> Void)?
-
Bind to connection/listener to a address & port.
Throws
LwIP ErrorDeclaration
Swift
public func bind(address: IP4Address, port: UInt16) throws
Parameters
address
IP Address to bind to
port
Port to bind to
-
Bind to connection/listener to a network interface. All packets sent/received are guaranteed to have come in via the specified
NetworkInterface
, and all outgoing packets will go out via the specifiedNetworkInterface
.Throws
LwIP ErrorDeclaration
Swift
public func bind(interface: NetworkInterface)
Parameters
address
IP Address to bind to
port
Port to bind to
-
Closes the connection
Declaration
Swift
public func close()