Created
November 30, 2020 08:56
-
-
Save standinga/79f5ef19ae49f536350deb3498f3d413 to your computer and use it in GitHub Desktop.
IOS/OSX Networking initial client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Client.swift | |
// MultiConnect | |
// | |
// Created by michal on 30/11/2020. | |
// | |
import Foundation | |
let client = Client() | |
class Client { | |
let browser = Browser() | |
var connection: Connection? | |
func start() { | |
browser.start { [weak self] result in | |
guard let self = self, | |
self.connection == nil else { return } | |
log("client.handler result: \(result)") | |
self.connection = Connection(endpoint: result.endpoint) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment