i broke it :)

This commit is contained in:
eskimo
2024-10-03 14:42:36 -04:00
parent 3280dfaa58
commit 49989b0e58
9 changed files with 279 additions and 63 deletions

View File

@@ -29,16 +29,16 @@ enum SocketState:String {
])
}
@objc public func create(id: String, host: String, port: Int, useTLS: Bool = false, acceptInvalidCertificates: Bool = false) -> Socket {
let socket = Socket(id: id, host: host, port: port, useTLS: useTLS, acceptInvalidCertificates: acceptInvalidCertificates)
@objc public func create(id: String) -> Socket {
let socket = Socket(id: id)
socket.delegate = self
sockets.append(socket)
return socket
}
@objc public func connect(id: String) {
@objc public func connect(id: String, host: String, port: Int, useTLS: Bool = false, acceptInvalidCertificates: Bool = false) {
if let socket = self.socket(with: id) {
socket.connect()
socket.connect(host: host, port: port, useTLS: useTLS, acceptInvalidCertificates: acceptInvalidCertificates)
}
}