Skip to content

Commit

Permalink
added prints
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoSax committed Sep 19, 2021
1 parent 1223150 commit 98c9851
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public class TransmissionToTransportConnection: Transport.Connection

public func receive(minimumIncompleteLength: Int, maximumLength: Int, completion: @escaping (Data?, NWConnection.ContentContext?, Bool, NWError?) -> Void)
{
print("TransmissionTransport receive called")
let error = NWError.posix(POSIXErrorCode.ECONNABORTED)
guard let queue = self.dispatch else {return}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ struct TransportToTransmissionConnection: TransmissionLinux.Connection

public func read(size: Int) -> Data?
{
print("TransmissionTransport read called")
return Synchronizer.sync({callback in return asyncRead(size: size, callback: callback)})
}

func asyncRead(size: Int, callback: @escaping (Data?) -> Void)
{
print("TransmissionTransport asyncRead called")
self.conn.receive(minimumIncompleteLength: size, maximumLength: size)
{
(data: Data?, context: NWConnection.ContentContext?, isComplete: Bool, maybeError: NWError?) in
Expand All @@ -41,18 +43,20 @@ struct TransportToTransmissionConnection: TransmissionLinux.Connection

public func write(string: String) -> Bool
{
print("TransmissionTransport string write called")
return write(data: string.data)
}

public func write(data: Data) -> Bool
{
print("TransmissionTransport data write called")
return Synchronizer.sync({callback in return asyncWrite(data: data, callback: callback)})
}

public func asyncWrite(data: Data, callback: @escaping (Bool) -> Void)
{
//FIXME: remove this print when the debugging is done
print("asyncWrite data write called: \(data.string)")
print("TransmissionTransport asyncWrite data write called: \(data.string)")
self.conn.send(content: data, contentContext: NWConnection.ContentContext.defaultMessage, isComplete: false, completion: NWConnection.SendCompletion.contentProcessed({
maybeError in

Expand Down

0 comments on commit 98c9851

Please sign in to comment.