Example #1
0
        /// <summary>
        /// Create a Connexion with the client
        /// </summary>
        /// <param name="tcpClient">TCP socket that connect the server to the client</param>
        /// <param name="executor">Fucntion to be executed with the instructions</param>
        public Connexion(TcpClient tcpClient, executer executor)
        {
            isActive = false;

            m_tcpClient = tcpClient;
            m_executor  = executor;

            theradReception = new Thread(new ThreadStart(receive));
            theradEmission  = new Thread(new ThreadStart(broadcast));
            threadTreatment = new Thread(new ThreadStart(treatData));
        }
Example #2
0
        public Connexion(String ip, executer executor, Char limitor = '\n')
        {
            isActive = false;
            m_ip     = ip;
            //m_tcpClient = tcpClient;
            m_executor = executor;
            m_limitor  = limitor;

            theradReception = new Thread(new ThreadStart(receive));
            theradEmission  = new Thread(new ThreadStart(broadcast));
            threadTreatment = new Thread(new ThreadStart(treatInstruction));

            instructionToSend = new ConcurrentQueue <String>();
            dataToTreat       = new ConcurrentQueue <String>();
        }