From 8989b38c04404def8d9ce41c0ed2a150dfb5d40c Mon Sep 17 00:00:00 2001 From: "Dr. Brandon Wiley" Date: Mon, 5 Oct 2020 14:30:50 -0500 Subject: [PATCH] Linux support --- Package.resolved | 13 +++++++++++-- Sources/Transport/Connection.swift | 4 ---- Sources/Transport/NWConnection+Connection.swift | 14 +++++++------- Tests/TransportTests/TransportTests.swift | 4 +--- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Package.resolved b/Package.resolved index 276356b..4b39b1e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -24,8 +24,17 @@ "repositoryURL": "https://github.com/OperatorFoundation/NetworkLinux.git", "state": { "branch": null, - "revision": "70d849482b2da95781cf72df3457e5cee7b3d3ad", - "version": "0.0.6" + "revision": "d176e9fb287c7e574b09f6565e69860194ee8931", + "version": "0.1.0" + } + }, + { + "package": "SwiftHexTools", + "repositoryURL": "https://github.com/OperatorFoundation/SwiftHexTools", + "state": { + "branch": null, + "revision": "4ce4a4f66eea05c900d447af8c07ecaac720716c", + "version": "1.2.2" } } ] diff --git a/Sources/Transport/Connection.swift b/Sources/Transport/Connection.swift index 27d187d..e5ebc24 100644 --- a/Sources/Transport/Connection.swift +++ b/Sources/Transport/Connection.swift @@ -19,10 +19,6 @@ public protocol Connection isComplete: Bool, completion: NWConnection.SendCompletion) - func receive(completion: @escaping (Data?, NWConnection.ContentContext?, Bool, NWError?) -> Void) - func receive(minimumIncompleteLength: Int, maximumLength: Int, completion: @escaping (Data?, NWConnection.ContentContext?, Bool, NWError?) -> Void) - - } diff --git a/Sources/Transport/NWConnection+Connection.swift b/Sources/Transport/NWConnection+Connection.swift index ff6a393..8aa35fb 100644 --- a/Sources/Transport/NWConnection+Connection.swift +++ b/Sources/Transport/NWConnection+Connection.swift @@ -6,17 +6,17 @@ // import Foundation + #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) - import Network + +import Network + #elseif os(Linux) - import NetworkLinux + +import NetworkLinux + #endif extension NWConnection: Connection { - public func receive(completion: @escaping (Data?, NWConnection.ContentContext?, Bool, NWError?) -> Void) - { - //FIXME - } - } diff --git a/Tests/TransportTests/TransportTests.swift b/Tests/TransportTests/TransportTests.swift index 59185eb..1b5e262 100644 --- a/Tests/TransportTests/TransportTests.swift +++ b/Tests/TransportTests/TransportTests.swift @@ -1,15 +1,13 @@ import XCTest @testable import Transport import Datable + #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) import Network #elseif os(Linux) import NetworkLinux #endif - - - class TransportTests: XCTestCase { static var allTests = [