still trying
This commit is contained in:
		
							parent
							
								
									53289dc092
								
							
						
					
					
						commit
						bcaf7ba62d
					
				@ -106,7 +106,7 @@ extension SocketEngineWebsocket {
 | 
			
		||||
                                               hostname: url.host ?? "localhost",
 | 
			
		||||
                                               port: Port(url.port ?? 80))
 | 
			
		||||
            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 }
 | 
			
		||||
 | 
			
		||||
                this.ws = ws
 | 
			
		||||
@ -172,6 +172,14 @@ extension WebSocket {
 | 
			
		||||
        return state == .open
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    func disconnect() {
 | 
			
		||||
        do {
 | 
			
		||||
            try close()
 | 
			
		||||
        } catch {
 | 
			
		||||
            DefaultSocketLogger.Logger.error("Error closing ws", type: "SocketEngineWebsocket", args: string)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    func write(string: String) {
 | 
			
		||||
        do {
 | 
			
		||||
            try send(string)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user