import Foundation

public protocol Transport: Sendable {
    func connect() async throws
    func send(_ data: Data) async throws
    func receive() -> AsyncThrowingStream<Data, Error>
    func disconnect() async
}

public struct TransportEndpoint: Sendable, Hashable {
    public let host: String
    public let port: Int

    public init(host: String, port: Int) {
        self.host = host
        self.port = port
    }
}
