Skip to content

Commit

Permalink
Now wraps Transport connections as well as NWConnections
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Brandon Wiley committed Apr 11, 2021
1 parent d888534 commit e2d4927
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Transmission/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Transport

public class Connection
{
var connection: NWConnection
var connection: Transport.Connection
var connectLock = DispatchGroup()
var readLock = DispatchGroup()
var writeLock = DispatchGroup()
Expand All @@ -28,14 +28,14 @@ public class Connection
}
}

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

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

var success = false

Expand Down Expand Up @@ -117,7 +117,7 @@ public class Connection
var success = false

self.writeLock.enter()
self.connection.send(content: data, completion: NWConnection.SendCompletion.contentProcessed(
self.connection.send(content: data, contentContext: NWConnection.ContentContext.defaultMessage, isComplete: false, completion: NWConnection.SendCompletion.contentProcessed(
{
(maybeError) in

Expand Down

0 comments on commit e2d4927

Please sign in to comment.