Esempio n. 1
0
        protected void receiveMainInfo(byte[] data, IRepository repository)
        {
            ClientVirtualProcessorsCount = BitConverter.ToInt32(data, 8);
            ClientFreeThreadsCount       = ClientVirtualProcessorsCount * 3 / 2;

            int compilersCount = BitConverter.ToInt32(data, 12);

            ClientCompilers.Clear();
            for (int i = 1; i <= compilersCount; i++)
            {
                ProgrammingLanguages pl = (ProgrammingLanguages)BitConverter.ToInt32(data, 12 + 4 * i);
                ClientCompilers.Add(pl);
                repository.MakeProgrammingLanguageAvailable(pl);

                Compilers.AddLanguage(pl);
            }

            SendRequestForProblemsInfo();
            _clientSendProblemsInfo.WaitOne();
            SendNewProblems();
        }