public void StartConnection(string version, X509Certificate2 cert) { #if DEBUG Logger.Debug("Setting up communication with the cloud servers"); #endif _connectionMaintainer = new ConnectionMaintainer(version, Servers, Ports, cert); _connectionMaintainer.Disconnected += (sender, args) => OnDisconnect(args); _connectionMaintainer.Connected += (sender, args) => OnConnect(args); _connectionMaintainerThread = new Thread(_connectionMaintainer.Run) { IsBackground = true, Name = "_connectionMaintainerThread" }; #if DEBUG Logger.Debug("Starting connection manager"); #endif _connectionMaintainerThread.Start(); }
public WebSocketMessageHandler(ConnectionMaintainer cm) { this._connectionMaintainer = cm; WebSocketClient = new WebSocketClient(this); WebSocketServer = new WebSocketServer(this); }