Skip to content

Commit

Permalink
Implemented Transport wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Brandon Wiley committed Apr 11, 2021
1 parent b4cd530 commit d888534
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
44 changes: 40 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
{
"object": {
"pins": [
{
"package": "Socket",
"repositoryURL": "https://github.com/OperatorFoundation/BlueSocket",
"state": {
"branch": null,
"revision": "90212ea8b66787c2d51d03527a04748ba6ee7679",
"version": "1.1.0"
}
},
{
"package": "Chord",
"repositoryURL": "https://github.com/OperatorFoundation/Chord",
"state": {
"branch": null,
"revision": "3d0189b4f6e71441d82c577c0f583fceace47684",
"version": "0.0.5"
"revision": "080cb496d8691571cad2ff241265a1e544d0960c",
"version": "0.0.10"
}
},
{
"package": "Datable",
"repositoryURL": "https://github.com/OperatorFoundation/Datable",
"state": {
"branch": null,
"revision": "808ab1b2c021be3d2950ec2c2894cd48d532d592",
"version": "3.0.3"
"revision": "aff3113e993217cae43180df9286eaa481682cce",
"version": "3.0.4"
}
},
{
"package": "NetworkLinux",
"repositoryURL": "https://github.com/OperatorFoundation/NetworkLinux.git",
"state": {
"branch": null,
"revision": "5b2fdbf29daeb5bba4fd4731080620a8fe3220e4",
"version": "0.3.0"
}
},
{
"package": "SwiftHexTools",
"repositoryURL": "https://github.com/OperatorFoundation/SwiftHexTools",
"state": {
"branch": null,
"revision": "4ce4a4f66eea05c900d447af8c07ecaac720716c",
"version": "1.2.2"
}
},
{
Expand All @@ -27,6 +54,15 @@
"revision": "0e5979acbb104516a427bb2bb09debc50ca100b4",
"version": "0.0.3"
}
},
{
"package": "Transport",
"repositoryURL": "https://github.com/OperatorFoundation/Transport",
"state": {
"branch": null,
"revision": "6cf442135c218560f317de6d17271849479d2186",
"version": "2.3.3"
}
}
]
},
Expand Down
3 changes: 2 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ let package = Package(
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/OperatorFoundation/Chord", from: "0.0.5"),
.package(url: "https://github.com/OperatorFoundation/Datable", from: "3.0.3"),
.package(url: "https://github.com/OperatorFoundation/Transport", from: "2.3.3"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Transmission",
dependencies: ["Chord", "Datable"]),
dependencies: ["Chord", "Datable", "Transport"]),
.testTarget(
name: "TransmissionTests",
dependencies: ["Transmission", "Datable"]),
Expand Down
6 changes: 6 additions & 0 deletions Sources/Transmission/Connection.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import Network
import Datable
import Transport

public class Connection
{
Expand Down Expand Up @@ -28,6 +29,11 @@ public class Connection
}

init?(connection: NWConnection)
{
return self.init(transport: connection)
}

init?(transport: Transport.Connection)
{
self.connection = connection

Expand Down

0 comments on commit d888534

Please sign in to comment.