Changes
6 changed files (+14/-12)
-
-
@@ -48,7 +48,7 @@@ObservationIgnored private var loop: Task<Void, Never>? = nil let serverID: String private(set) var serverID: String? let host: String let port: UInt16
-
@@ -99,7 +99,7 @@ }#endif init( serverID: String, serverID: String? = nil, host: String, port: UInt16, token: String? = nil,
-
-
-
@@ -77,11 +77,9 @@ }#endif let port = UserDefaults.standard.integer(forKey: StorageKeys.serverPort) let serverID = UserDefaults.standard.string(forKey: StorageKeys.serverID) guard let serverID = UserDefaults.standard.string( forKey: StorageKeys.serverID ), let host = UserDefaults.standard.string(forKey: StorageKeys.serverHost), port > 0 else {
-
-
-
@@ -453,7 +453,7 @@ func send(_ msg: consuming Moo) async throws {}} extension MockServer: Connectable { var serverID: String { "mock-server" } var serverID: String? { "mock-server" } var host: String { "192.0.2.1" } var port: UInt16 { 9003 }
-
-
-
@@ -64,7 +64,7 @@ Text(String( localized: "ConnectionScreen.NotFound.Description", defaultValue: "Server \(self.conn.serverID) does not found on network." "Server \(self.conn.serverID ?? "\(self.conn.host):\(self.conn.port)") does not found on network." ) ) } actions: {
-
-
-
@@ -16,7 +16,7 @@ // SPDX-License-Identifier: Apache-2.0public protocol Connectable: Actor { /// Roon server ID of the target Roon Core. var serverID: String { get } var serverID: String? { get } /// Host, mostly IPv4 address of the target Roon Core. var host: String { get }
-
-
-
@@ -21,7 +21,7 @@public actor Connection: Connectable, Communicatable { private let logger = Logger(subsystem: subsystem, category: "Connection") public let serverID: String public private(set) var serverID: String? public let host: String public let port: UInt16 public let ext: RegistryService.Extension
-
@@ -46,7 +46,7 @@ case invalidHost} public init( id: String, id: String? = nil, host: String, port: UInt16, ext: RegistryService.Extension
-
@@ -164,8 +164,12 @@ do {logger.debug("Querying server info") let res = try await request(Moo(info: .init()), timeout: .seconds(3)) let info = try RegistryService.InfoResponse(res) guard info.coreId == serverID else { throw ConnectError.serverIDMismatch if let serverID = serverID { guard info.coreId == serverID else { throw ConnectError.serverIDMismatch } } else { serverID = info.coreId } }
-