/// <summary>
 /// Creates a RecieveThread to recieve messages on the specified protocol
 /// </summary>
 /// <param name="protocol">The protocol to recieve messages from</param>
 /// <param name="server">The server to recieve for</param>
 public RecieveThread(IProtocol protocol, INovaServer server)
 {
     protocols.Add(protocol);
     this.server = server;
     thread = new Thread(RecieveLoop);
     log = LogManager.GetLogger(typeof(RecieveThread));
 }
 /// <summary>
 /// Creates a DispatchThread for the specified server
 /// </summary>
 /// <param name="server">The server to dispatch messages for</param>
 public DispatchThread(INovaServer server)
 {
     this.server = server;
     id = DispatchThread.NextId; // Assign an ID
     if (DispatchThread.NextId == long.MaxValue) // We might run out, but its unlikely
         DispatchThread.NextId = -1; // Use the "Ran out of IDs" id :)
     else if (DispatchThread.NextId > 0)
         DispatchThread.NextId++;
     log = LogManager.GetLogger(String.Format("{2}:{0}#{1}", typeof(DispatchThread).FullName, id, server.Name));
     thread = new Thread(DispatchLoop);
 }
        /// <summary>
        /// Creates a RecieveThread to recieve messages on the specified protocols
        /// </summary>
        /// <param name="protocols">A list of protocols to recieve messages from</param>
        /// <param name="server">The server to recieve for</param>
        public RecieveThread(List<IProtocol> protocols, INovaServer server)
        {
            this.protocols = protocols;
            this.server = server;
            thread = new Thread(RecieveLoop);

            id = RecieveThread.NextId; // Assign an ID
            if (RecieveThread.NextId == long.MaxValue) // We might run out, but its unlikely
                RecieveThread.NextId = -1; // Use the "Ran out of IDs" id :)
            else if(RecieveThread.NextId > 0) // If we haven't "run out"
                RecieveThread.NextId++; // Increment ID
            log = LogManager.GetLogger(String.Format("{2}:{0}#{1}", typeof(RecieveThread).FullName, id, server.Name));
        }
 /// <summary>
 /// Creates a new ComponentManager for the specified server
 /// </summary>
 /// <param name="server">The server to manage components for</param>
 public ComponentManager(INovaServer server)
 {
     log = LogManager.GetLogger(String.Format("{0}:{1}", typeof(ComponentManager).FullName, server.Name));
 }