Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Сети";
Текущий архив: 2003.09.01;
Скачать: [xml.tar.bz2];

Вниз

Sockets API   Найти похожие ветки 

 
panov   (2003-06-27 14:12) [0]

Если сокеты(socket) создаются в различных потоках, необходимо ли в каждом потоке при создании вызавать WSAStartup, а при уничтожении потока WSACleanup, или WSACleanup достаточно выполнить один раз для всего приложения?
Проблема в том, что если в потоке не выдать WSACleanup, то после уничтожения потока с сокетом остается "мертвый" поток, созданный после WSAStartup+connect.

Спасибо.
-------------------


 
Wonder   (2003-06-27 14:27) [1]

This function MUST be the first Windows Sockets function called by an application or DLL. It allows an application or DLL to specify the version of Windows Sockets API required and to retrieve details of the specific Windows Sockets implementation. The application or DLL may only issue further Windows Sockets API functions after a successful WSAStartup() invocation.

Вообще-то, наверное, надо только один раз вызвать. Но:

An application or DLL may call WSAStartup() more than once if it needs to obtain the WSAData structure information more than once. However, the wVersionRequired parameter is assumed to be the same on all calls to WSAStartup(); that is, an application or DLL cannot change the version of Windows Sockets it expects after the initial call to WSAStartup().

There must be one WSACleanup() call corresponding to every WSAStartup() call to allow third-party DLLs to make use of a Windows Sockets DLL on behalf of an application. This means, for example, that if an application calls WSAStartup() three times, it must call WSACleanup() three times. The first two calls to WSACleanup() do nothing except decrement an internal counter; the final WSACleanup() call for the task does all necessary resource deallocation for the task.





Страницы: 1 вся ветка

Форум: "Сети";
Текущий архив: 2003.09.01;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.44 MB
Время: 0.011 c
1-1482
gedd
2003-08-18 13:21
2003.09.01
Подскажите какой gauge лучше использовать?


14-1563
VEG
2003-08-11 20:20
2003.09.01
Радиосеть


3-1312
Vlad
2003-08-08 15:30
2003.09.01
Direct Oracle Access


14-1559
Mr&MsGuns
2003-08-11 18:59
2003.09.01
Создание библиотек


14-1664
Andryk
2003-08-14 10:51
2003.09.01
Вопрос на засыпку :о))





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский