Open() 공개 메소드

public Open ( ) : void
리턴 void
예제 #1
0
		private void ServerRecover(object unused)
		{
			lock(_lock)
			{
				if(!_failed)
					return;

				var connection = new Connection(_server, ConnectionType.Simple, 1024);

				try
				{
					connection.Open();
					_failed = false;
				}
				catch { }
				finally
				{
					connection.Close();
				}
			}
		}
		private void ServerRecover()
		{
			try
			{
				if (_blackListed.Count > 0)
				{
					var clonedBlackList = (HashSet<Server>)null;

					lock (_lock)
						clonedBlackList = new HashSet<Server>(_blackListed);

					foreach (var server in clonedBlackList)
					{
						var connection = new Connection(server, ConnectionType.Simple, 1024);

						try
						{
							connection.Open();
							lock(_lock)
							{
							   _blackListed.Remove(server);
							   _serverQueue.Enqueue(server);
							}
						}
						catch { }
						finally
						{
							connection.Close();
						}
					}
					clonedBlackList.Clear();
				}
			}
			finally
			{
				_recoveryTimer.Change(_recoveryTimerInterval, Timeout.Infinite);
			}
		}