Skip to content

Instantly share code, notes, and snippets.

@standinga
Created November 30, 2020 08:56
Show Gist options
  • Save standinga/79f5ef19ae49f536350deb3498f3d413 to your computer and use it in GitHub Desktop.
Save standinga/79f5ef19ae49f536350deb3498f3d413 to your computer and use it in GitHub Desktop.
IOS/OSX Networking initial client
//
// 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