mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 16:53:29 +01:00
Replace some Roxas with Roxas UI
Signed-off-by: Joseph Mattello <mail@joemattiello.com>
This commit is contained in:
committed by
Joe Mattiello
parent
f270ecc537
commit
a6559d8bb9
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
import Network
|
||||
import SideKit
|
||||
|
||||
public class NetworkConnection: NSObject, Connection
|
||||
public class NetworkConnection: NSObject, SideConnection
|
||||
{
|
||||
public let nwConnection: NWConnection
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user