Appearance
Wire
Protcol describing a simple connection, able to send and reveive Data
swift
protocol Wire : Sendable
Overview
You can find prepared implementations in the flake-swift-tcp-wire
and flake-swift-bluetooth-wire
packages
Instance Properties
gotClosedPublisher
swift
var gotClosedPublisher: AnyPublisher<Void, Never>
Publisher to inform the Transort that the Connection is closed
receivedDataPublisher
swift
var receivedDataPublisher: AnyPublisher<Data, Error>
Publisher to relay received Data to the Transport
Instance Methods
close()
swift
func close()
Closes the Connection
open()
swift
func open() async throws
Opens the Connection
send(_😃
swift
func send(Data) async throws -> Int
This send the provided Data over the Wire