Слово
«hevents»впервые сказано пользователем
marain 07.01.2009 в 01:53,
и с тех пор употреблялось
10 раз.
Сообщения со словом
«hevents»
Запрос выполнился за
0.0057 сек.
- 07.01.2009, 01:53. marain в теме
«Программный шлюз не хочет читать :(»
... winapi mainthread lpvoid lpparam int res int i wsaevent hevents null dword dwindex connection conn connection lpparam hevents wsaevent globalalloc gmem fixed gmem zeroinit sizeof wsaevent 2 if hevents null event printf globalalloc failed s r n const char sys sockgetlasterror return 1 for i 0 i 2 i hevents i wsacreateevent if hevents i null event printf wsacreateevent failed s r n const char sys sockgetlasterror return 1 if wsaeventselect conn- in sock hevents 0 fd read fd write fd close socket error wsaeventselect conn- out sock hevents 1 fd read fd write fd connect fd close socket error event printf wsaeventselect failed s r n const char sys sockgetlasterror return 1 i 0 while 1 printf i n i dwindex wsawaitformultipleevents 2 hevents false wsa infinite 10000 false if dwindex wsa wait failed event printf wsaeventselect failed s r n const char sys sockgetlasterror return 1 dwindex wsa wait event 0 if dwindex 0 printf i n conn- in sock if conn- status connected conn- suspended perform read conn conn- in sock conn- out buf conn- out buf len if conn- status connected conn- suspended perform write conn conn- out sock conn- out buf conn- out buf len else printf i--- n conn- out sock if conn- status connected conn- suspended perform read conn conn- out sock conn- in buf conn- in buf len if conn- status connected conn- suspended perform write conn conn- in sock conn- in buf conn- in buf len if conn- status connecting perform connect conn if conn- status closing conn- in buf len conn- out buf len time null -conn- stop linger close connection conn break wsaresetevent hevents dwindex i for i 0 i 2 i wsacloseevent hevents i globalfree hevents return 0 без событий все отрабатывает ок просто...