public ClientCommandChain() : base()
        {
            incomingCommandsChain = new Queue <Command>();
            commandsChain         = new Queue <Command>();

            //Connect Server
            Thread startServer = new Thread(new ThreadStart(AsynchronousServerConnection.Start));

            startServer.IsBackground = true;
            startServer.Name         = "Start Server";
            startServer.Start();

            //Add event handler for server answer ready event
            AsynchronousServerConnection.AddAnswerDataReadyHandler((sender, args) => addIncomingCommand(sender, args));


            //Start new thread for handling answers
            Thread answersHandler = new Thread(new ThreadStart(incomingCommandsHanddler));

            answersHandler.IsBackground = true;
            answersHandler.Name         = "Answer Handler";
            answersHandler.Start();

            //Start new thread for handling commands
            Thread commandHandler = new Thread(new ThreadStart(sendCommand));

            commandHandler.IsBackground = true;
            commandHandler.Name         = "Command Handler";
            commandHandler.Start();
        }
        /// <summary>
        /// Sends command to the server
        /// </summary>
        protected override void sendCommand()
        {
            Command command = null;

            while (true)
            {
                //If there isn't any command, then wait for a signal from addCommand method
                if (commandsChain.Count == 0)
                {
                    newCommand.WaitOne();
                }
                newCommand.Reset();

                while (commandsChain.Count != 0)
                {
                    //TODO handle if SendData method return false

                    //Send first command
                    command = getCommand();
                    AsynchronousServerConnection.SendData(command);
                }
            }
        }