Replace some Roxas with Roxas UI

Signed-off-by: Joseph Mattello <mail@joemattiello.com>
This commit is contained in:
Joseph Mattello
2023-02-25 01:38:29 -05:00
committed by Joe Mattiello
parent f270ecc537
commit a6559d8bb9
41 changed files with 55 additions and 44 deletions

View File

@@ -10,7 +10,12 @@ import Foundation
import Network
import SideKit
public extension Connection
public protocol SideConnection: Connection {
func __send(_ data: Data, completionHandler: @escaping (Bool, Error?) -> Void)
func __receiveData(expectedSize: Int, completionHandler: @escaping (Data?, Error?) -> Void)
}
public extension SideConnection
{
func send(_ data: Data, completionHandler: @escaping (Result<Void, ALTServerError>) -> Void)
{
@@ -24,7 +29,7 @@ public extension Connection
completionHandler(result)
}
}
func receiveData(expectedSize: Int, completionHandler: @escaping (Result<Data, ALTServerError>) -> Void)
{
self.__receiveData(expectedSize: expectedSize) { (data, error) in
@@ -32,7 +37,7 @@ public extension Connection
guard let nwError = failure as? NWError else { return ALTServerError.init(failure) }
return ALTServerError.lostConnection(underlyingError: nwError)
}
completionHandler(result)
}
}

View File

@@ -10,7 +10,7 @@ import Foundation
import Network
import SideKit
public class NetworkConnection: NSObject, Connection
public class NetworkConnection: NSObject, SideConnection
{
public let nwConnection: NWConnection

View File

@@ -23,7 +23,7 @@ extension XPCConnection
public static let machServiceNames = [unc0verMachServiceName, odysseyMachServiceName]
}
public class XPCConnection: NSObject, Connection
public class XPCConnection: NSObject, SideConnection
{
public let xpcConnection: NSXPCConnection