still trying
This commit is contained in:
parent
53289dc092
commit
bcaf7ba62d
@ -106,7 +106,7 @@ extension SocketEngineWebsocket {
|
|||||||
hostname: url.host ?? "localhost",
|
hostname: url.host ?? "localhost",
|
||||||
port: Port(url.port ?? 80))
|
port: Port(url.port ?? 80))
|
||||||
let stream: ClientStream = secure ? try TLS.InternetSocket(socket, TLS.Context(.client)) : socket
|
let stream: ClientStream = secure ? try TLS.InternetSocket(socket, TLS.Context(.client)) : socket
|
||||||
try WebSocket.background(to: url, using: stream) {[weak self] ws in
|
try WebSocket.background(to: urlWebSocketWithSid.absoluteString, using: stream) {[weak self] ws in
|
||||||
guard let this = self else { return }
|
guard let this = self else { return }
|
||||||
|
|
||||||
this.ws = ws
|
this.ws = ws
|
||||||
@ -172,6 +172,14 @@ extension WebSocket {
|
|||||||
return state == .open
|
return state == .open
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func disconnect() {
|
||||||
|
do {
|
||||||
|
try close()
|
||||||
|
} catch {
|
||||||
|
DefaultSocketLogger.Logger.error("Error closing ws", type: "SocketEngineWebsocket", args: string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func write(string: String) {
|
func write(string: String) {
|
||||||
do {
|
do {
|
||||||
try send(string)
|
try send(string)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user