Inheritance: IDisposable
Exemple #1
0
		public MessagePump()
		{
			IPEndPoint[] ipep = Listener.EndPoints;

			m_Listeners = new Listener[ipep.Length];

			bool success = false;

			do {
				for ( int i = 0; i < ipep.Length; i++ ) {
					Listener l = new Listener( ipep[i] );
					if ( !success && l != null )
						success = true;
					m_Listeners[i] = l;
				}

				if ( !success ) {
					Console.WriteLine( "Retrying..." );
					Thread.Sleep( 10000 );
				}
			} while ( !success );

			m_Queue = new Queue<NetState>();
			m_WorkingQueue = new Queue<NetState>();
			m_Throttled = new Queue<NetState>();
			m_Peek = new byte[4];
		}
Exemple #2
0
		public MessagePump()
		{
			IPEndPoint[] ipep = Listener.EndPoints;

			m_Listeners = new Listener[ipep.Length];

			bool success = false;

			do
			{
				for (int i = 0; i < ipep.Length; i++)
				{
					var l = new Listener(ipep[i]);
					if (!success && l != null)
					{
						success = true;
					}
					m_Listeners[i] = l;
				}

				if (!success)
				{
					Utility.PushColor(ConsoleColor.Yellow);
					Console.WriteLine("Retrying...");
					Utility.PopColor();
					Thread.Sleep(10000);
				}
			}
			while (!success);

			m_Queue = new Queue<NetState>();
			m_WorkingQueue = new Queue<NetState>();
			m_Throttled = new Queue<NetState>();
		}
Exemple #3
0
 public NetServer( Listener listener )
 {
     m_Listeners = new List<Listener>() { listener };
     m_NetStates = new List<NetState>();
     m_PendingQueue = new Queue<NetState>();
     m_ThrottledQueue = new Queue<NetState>();
     m_DisposedQueue = new ConcurrentQueue<NetState>();
 }
Exemple #4
0
		public void AddListener( Listener l )
		{
			Listener[] old = m_Listeners;

			m_Listeners = new Listener[old.Length + 1];

			for ( int i = 0; i < old.Length; ++i )
				m_Listeners[i] = old[i];

			m_Listeners[old.Length] = l;
		}
Exemple #5
0
 public void AddListener( Listener listener )
 {
     m_Listeners.Add( listener );
 }