Answer the question
In order to leave comments, you need to log in
Global ip for server in c#?
I understand with writing of the server on c#. Here is the beginning of the code.
// Определим нужное максимальное количество потоков
// Пусть будет по 4 на каждый процессор
int MaxThreadsCount = Environment.ProcessorCount * 4;
Console.WriteLine(MaxThreadsCount.ToString());
// Установим максимальное количество рабочих потоков
ThreadPool.SetMaxThreads(MaxThreadsCount, MaxThreadsCount);
// Установим минимальное количество рабочих потоков
ThreadPool.SetMinThreads(2, 2);
// Устанавливаем порт для TcpListener = 9595.
Int32 port = 9595;
IPAddress localAddr = IPAddress.Parse("127.0.0.1");
int counter = 0;
server = new TcpListener(localAddr, port);
// Запускаем TcpListener и начинаем слушать клиентов.
server.Start();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question