private void HubTest(string protocol) { _settings.Protocol = protocol; Hub hubConnection = new Hub(_settings, this); hubConnection.SecureUpdate += new FmdcEventHandler(hubConnection_SecureUpdate); hubConnection.ProtocolChange += new FmdcEventHandler(hubConnection_ProtocolChange); hubConnection.Connect(); int i = 0; while (!_isFinished && i++ < 20) { Thread.Sleep(500); } hubConnection.Disconnect("Test time exceeded"); hubConnection.Dispose(); }
private void HubTest(string protocol) { _settings.Protocol = protocol; Hub hubConnection = new Hub(_settings); hubConnection.ConnectionStatusChange += new FlowLib.Events.FmdcEventHandler(OnConnectionStatusChange); hubConnection.SecureUpdate += new FmdcEventHandler(hubConnection_SecureUpdate); Hub.RegModeUpdated += new FmdcEventHandler(Hub_RegModeUpdated); hubConnection.Connect(); int i = 0; while (!_isFinished && i++ < 20) { Thread.Sleep(100); } hubConnection.ConnectionStatusChange -= OnConnectionStatusChange; hubConnection.Disconnect("Test time exceeded"); hubConnection.Dispose(); }
private void HubTest(string protocol, ConnectionTypes connectionType) { _settings.Protocol = protocol; _hubConnection = new Hub(_settings, this); _hubConnection.ProtocolChange += new FmdcEventHandler(hubConnection_ProtocolChange); // We need to have a share _hubConnection.Share = new Share("temp"); _hubConnection.Me.TagInfo.Mode = connectionType; _hubConnection.Connect(); //Thread thread = new Thread(new ThreadStart(AutoDownloadNewStuff)); //thread.IsBackground = true; //thread.Start(); int i = 0; while (!_isFinished && i++ < _testTimeoutLength) { Thread.Sleep(500); } // Close all open threads //thread.Abort(); _hubConnection.Disconnect("Test time exceeded"); _hubConnection.Dispose(); }