Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / C++ [игнор отключен] [закрыт для гостей] / TCP UDP / 3 сообщений из 3, страница 1 из 1
21.03.2004, 17:42
    #32450559
ALFA Soft
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
TCP UDP
Hello. I actually have more than one question and I don't know whether I should post separate topics or write all in one, so since they all are about implementing a server I'll keep it simple - all here.

Brief info first, the server should deal with both TCP and UDP protocols: TCP for transferring large amounts of data, files and pre-loading caching, UDP for game-state-updates and small in-game information chunks which are critical on delivery speed and size. It should run on Windows/Winsock.

The first question is: what's a better idea - to have one program running which deals with both UDP and TCP parts or to keep them separate?

The second question is about the TCP server: it should support multiple [>1000] connections at once. What's the best way to organize the connections part - using Windows asynchronous sockets or 1-thread-per-connection style or anything else I may not be informed about?

Thanks a lot for help..
...
Рейтинг: 0 / 0
21.03.2004, 18:34
    #32450581
vdimas
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
TCP UDP
1. Why not.
TCP encapsulates the some complexity related to reliability,
UDP, as it's known, has much smaller time of the response.

if the using of the 2 IP ports is not a problem - use them simultaneously


2. use the asynchronous sockets with thread pool for request proccesing,
don't forget to specify the enough queue length
...
Рейтинг: 0 / 0
24.03.2004, 11:13
    #32454401
_Konst
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
TCP UDP
vdimas2. use the asynchronous sockets with thread pool for request proccesing,
don't forget to specify the enough queue length

Some corrections...
The number of threads in pool must be approximatly equal to number of computer processors in other case you will spend a lot of time for context switching between different threads. See for examle J. Richter book "Programming server-side applications for Windows 2000". As I know (from this book, not from practice) the best solution is using of Input-Output completion port. See help for CreateIoCompletionPort function.
...
Рейтинг: 0 / 0
Форумы / C++ [игнор отключен] [закрыт для гостей] / TCP UDP / 3 сообщений из 3, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]