Connection.swift 436 B

123456789101112131415161718
  1. //
  2. // Connection.swift
  3. // AltKit
  4. //
  5. // Created by Riley Testut on 6/1/20.
  6. // Copyright © 2020 Riley Testut. All rights reserved.
  7. //
  8. import Foundation
  9. import Network
  10. public protocol Connection
  11. {
  12. func send(_ data: Data, completionHandler: @escaping (Result<Void, ALTServerError>) -> Void)
  13. func receiveData(expectedSize: Int, completionHandler: @escaping (Result<Data, ALTServerError>) -> Void)
  14. func disconnect()
  15. }