Skip to content

Commit

Permalink
Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Brandon Wiley committed Oct 5, 2020
1 parent e9fdb30 commit 8989b38
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
13 changes: 11 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
Expand Down
4 changes: 0 additions & 4 deletions Sources/Transport/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)


}

14 changes: 7 additions & 7 deletions Sources/Transport/NWConnection+Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

}
4 changes: 1 addition & 3 deletions Tests/TransportTests/TransportTests.swift
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down

0 comments on commit 8989b38

Please sign in to comment.