青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 58,  comments - 75,  trackbacks - 0

1
int ACE_WFMO_Reactor::handle_events (ACE_Time_Value &how_long)
{
? return this->event_handling (&how_long, FALSE);
}

2
// Waits for and dispatches all events.? Returns -1 on error, 0 if
// max_wait_time expired, or the number of events that were dispatched.
int ACE_WFMO_Reactor::event_handling (ACE_Time_Value *max_wait_time,
????????????????????????????????????? int alertable)
{
? ACE_TRACE ("ACE_WFMO_Reactor::event_handling");

? // Make sure we are not closed
? if (!this->open_for_business_ || this->deactivated_)
????? return -1;

? // Stash the current time -- the destructor of this object will
? // automatically compute how much time elapsed since this method was
? // called.
? ACE_Countdown_Time countdown (max_wait_time);

? int result;
?
? do
? {
????? // Check to see if it is ok to enter ::WaitForMultipleObjects
????? // This will acquire <this->lock_> on success On failure, the
????? // lock will not be acquired
?????
????? result = this->ok_to_wait (max_wait_time, alertable);
????? if (result != 1)
??????? return result;

????? // Increment the number of active threads
????? ++this->active_threads_;

????? // Release the <lock_>
????? this->lock_.release ();

????? // Update the countdown to reflect time waiting to play with the
????? // mut and event.
?????
????? countdown.update ();

????? // Calculate timeout
????? int timeout = this->calculate_timeout (max_wait_time);

????? // Wait for event to happen
????? DWORD wait_status = this->wait_for_multiple_events (timeout,
????????????????????????????????????????????????????????? alertable);

????? // Upcall
????? result = this->safe_dispatch (wait_status);
????? if (0 == result)
????? {
????????? // wait_for_multiple_events timed out without dispatching
????????? // anything.? Because of rounding and conversion errors and
????????? // such, it could be that the wait loop timed out, but
????????? // the timer queue said it wasn't quite ready to expire a
????????? // timer. In this case, max_wait_time won't have quite been
????????? // reduced to 0, and we need to go around again. If max_wait_time
????????? // is all the way to 0, just return, as the entire time the
????????? // caller wanted to wait has been used up.
????????? countdown.update ();???? // Reflect time waiting for events
?????????
????????? if (0 == max_wait_time || max_wait_time->usec () == 0)
??????????? break;
????? }
? }while (result == 0);

? return result;
}

3
int ACE_WFMO_Reactor::safe_dispatch (DWORD wait_status)
{
? int result = -1;
? ACE_SEH_TRY
? {
????? result = this->dispatch (wait_status);
? }
? ACE_SEH_FINALLY
? {
????? this->update_state ();
? }

? return result;
}

4
int ACE_WFMO_Reactor::dispatch (DWORD wait_status)
{
? int handlers_dispatched = 0;

? // Expire timers
? handlers_dispatched += this->expire_timers ();

? switch (wait_status)
? {
? case WAIT_FAILED: // Failure.
????? ACE_OS::set_errno_to_last_error ();
????? return -1;

? case WAIT_TIMEOUT: // Timeout.
????? errno = ETIME;
????? return handlers_dispatched;

? default:? // Dispatch.
????? // We'll let dispatch worry about abandoned mutes.
????? handlers_dispatched += this->dispatch_handles (wait_status);
????? return handlers_dispatched;
? }
}

5
// Dispatches any active handles from <handles_[slot]> to
// <handles_[max_handlep1_]>, polling through our handle set looking
// for active handles.

int ACE_WFMO_Reactor::dispatch_handles (DWORD wait_status)
{
? // dispatch_slot is the absolute slot.? Only += is used to
? // increment it.
? DWORD dispatch_slot = 0;

? // Cache this value, this is the absolute value.
? DWORD max_handlep1 = this->handler_rep_.max_handlep1 ();

? // nCount starts off at <max_handlep1>, this is a transient count of
? // handles last waited on.
? DWORD nCount = max_handlep1;

? for (int number_of_handlers_dispatched = 1;;++number_of_handlers_dispatched)
? {
????? const bool ok = (wait_status >= WAIT_OBJECT_0 && wait_status <= (WAIT_OBJECT_0 + nCount));

????? if (ok)
??????? dispatch_slot += wait_status - WAIT_OBJECT_0;
????? else
??????? // Otherwise, a handle was abandoned.
??????? dispatch_slot += wait_status - WAIT_ABANDONED_0;

????? // Dispatch handler
????? if (this->dispatch_handler (dispatch_slot, max_handlep1) == -1)
??????? return -1;

????? // Increment slot
????? ++dispatch_slot;

????? // We're done.
????? if (dispatch_slot >= max_handlep1)
??????? return number_of_handlers_dispatched;

????? // Readjust nCount
????? nCount = max_handlep1 - dispatch_slot;

????? // Check the remaining handles
????? wait_status = this->poll_remaining_handles (dispatch_slot);
????? switch (wait_status)
????? {
??????? case WAIT_FAILED: // Failure.
????????? ACE_OS::set_errno_to_last_error ();
????????? /* FALLTHRU */
??????? case WAIT_TIMEOUT:
????????? // There are no more handles ready, we can return.
????????? return number_of_handlers_dispatched;
????? }
? }
}

6
int ACE_WFMO_Reactor::dispatch_handler (DWORD slot,
??????????????????????????????????????? DWORD max_handlep1)
{
? // Check if there are window messages that need to be dispatched
? if (slot == max_handlep1)
??? return this->dispatch_window_messages ();

? // Dispatch the handler if it has not been scheduled for deletion.
? // Note that this is a very week test if there are multiple threads
? // dispatching this slot as no locks are held here. Generally, you
? // do not want to do something like deleting the this pointer in
? // handle_close() if you have registered multiple times and there is
? // more than one thread in WFMO_Reactor->handle_events().
? else if (!this->handler_rep_.scheduled_for_deletion (slot))
? {
????? ACE_HANDLE event_handle = *(this->handler_rep_.handles () + slot);

????? if (this->handler_rep_.current_info ()[slot].io_entry_)
??????? return this->complex_dispatch_handler (slot,
?????????????????????????????????????????????? event_handle);
????? else
??????? return this->simple_dispatch_handler (slot,
????????????????????????????????????????????? event_handle);
? }
? else
??? // The handle was scheduled for deletion, so we will skip it.
??? return 0;
}

7
int ACE_WFMO_Reactor::complex_dispatch_handler (DWORD slot,
??????????????????????????????????????????????? ACE_HANDLE event_handle)
{
? // This dispatch is used for I/O entires.

? ACE_WFMO_Reactor_Handler_Repository::Current_Info &current_info =
??? this->handler_rep_.current_info ()[slot];

? WSANETWORKEVENTS events;
? ACE_Reactor_Mask problems = ACE_Event_Handler::NULL_MASK;
? if (::WSAEnumNetworkEvents ((SOCKET) current_info.io_handle_,
????????????????????????????? event_handle,
????????????????????????????? &events) == SOCKET_ERROR)
??? problems = ACE_Event_Handler::ALL_EVENTS_MASK;
? else
? {
????? // Prepare for upcalls. Clear the bits from <events> representing
????? // events the handler is not interested in. If there are any left,
????? // do the upcall(s). upcall will replace events.lNetworkEvents
????? // with bits representing any functions that requested a repeat
????? // callback before checking handles again. In this case, continue
????? // to call back unless the handler is unregistered as a result of
????? // one of the upcalls. The way this is written, the upcalls will
????? // keep being done even if one or more upcalls reported problems.
????? // In practice this may turn out not so good, but let's see. If any
????? // problems, please notify Steve Huston <shuston@riverace.com>
????? // before or after you change this code.
????? events.lNetworkEvents &= current_info.network_events_;
????? while (events.lNetworkEvents != 0)
????? {
????????? ACE_Event_Handler *event_handler = current_info.event_handler_;

????????? int reference_counting_required =
??????????? event_handler->reference_counting_policy ().value () ==
??????????? ACE_Event_Handler::Reference_Counting_Policy::ENABLED;

????????? // Call add_reference() if needed.
????????? if (reference_counting_required)
????????? {
????????????? event_handler->add_reference ();
????????? }

????????? // Upcall
????????? problems |= this->upcall (current_info.event_handler_,
??????????????????????????????????? current_info.io_handle_,
??????????????????????????????????? events);

????????? // Call remove_reference() if needed.
????????? if (reference_counting_required)
????????? {
????????????? event_handler->remove_reference ();
????????? }

????????? if (this->handler_rep_.scheduled_for_deletion (slot))
??????????? break;
????? }
? }

? if (problems != ACE_Event_Handler::NULL_MASK
????? && !this->handler_rep_.scheduled_for_deletion (slot)? )
??? this->handler_rep_.unbind (event_handle, problems);

? return 0;
}

8
ACE_Reactor_Mask ACE_WFMO_Reactor::upcall (ACE_Event_Handler *event_handler,
?????????????????????????????????????????? ACE_HANDLE io_handle,
?????????????????????????????????????????? WSANETWORKEVENTS &events)
{
? // This method figures out what exactly has happened to the socket
? // and then calls appropriate methods.
? ACE_Reactor_Mask problems = ACE_Event_Handler::NULL_MASK;

? // Go through the events and do the indicated upcalls. If the handler
? // doesn't want to be called back, clear the bit for that event.
? // At the end, set the bits back to <events> to request a repeat call.

? long actual_events = events.lNetworkEvents;
? int action;

? if (ACE_BIT_ENABLED (actual_events, FD_WRITE))
? {
????? action = event_handler->handle_output (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_WRITE);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::WRITE_MASK);
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_CONNECT))
? {
????? if (events.iErrorCode[FD_CONNECT_BIT] == 0)
????? {
????????? // Successful connect
????????? action = event_handler->handle_output (io_handle);
????????? if (action <= 0)
????????? {
????????????? ACE_CLR_BITS (actual_events, FD_CONNECT);
????????????? if (action == -1)
??????????????? ACE_SET_BITS (problems, ACE_Event_Handler::CONNECT_MASK);
????????? }
????? }
????? // Unsuccessful connect
????? else
????? {
????????? action = event_handler->handle_input (io_handle);
????????? if (action <= 0)
????????? {
????????????? ACE_CLR_BITS (actual_events, FD_CONNECT);
????????????? if (action == -1)
??????????????? ACE_SET_BITS (problems, ACE_Event_Handler::CONNECT_MASK);
????????? }
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_OOB))
? {
????? action = event_handler->handle_exception (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_OOB);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::EXCEPT_MASK);
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_READ))
? {
????? action = event_handler->handle_input (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_READ);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::READ_MASK);
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_CLOSE)
????? && ACE_BIT_DISABLED (problems, ACE_Event_Handler::READ_MASK))
? {
????? action = event_handler->handle_input (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_CLOSE);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::READ_MASK);
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_ACCEPT))
? {
????? action = event_handler->handle_input (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_ACCEPT);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::ACCEPT_MASK);
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_QOS))
? {
????? action = event_handler->handle_qos (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_QOS);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::QOS_MASK);
????? }
? }

? if (ACE_BIT_ENABLED (actual_events, FD_GROUP_QOS))
? {
????? action = event_handler->handle_group_qos (io_handle);
????? if (action <= 0)
????? {
????????? ACE_CLR_BITS (actual_events, FD_GROUP_QOS);
????????? if (action == -1)
??????????? ACE_SET_BITS (problems, ACE_Event_Handler::GROUP_QOS_MASK);
????? }
? }

? events.lNetworkEvents = actual_events;
? return problems;
}

posted on 2007-02-22 10:54 walkspeed 閱讀(1621) 評論(0)  編輯 收藏 引用 所屬分類: ACE Farmeworks

<2007年2月>
28293031123
45678910
11121314151617
18192021222324
25262728123
45678910

常用鏈接

留言簿(4)

隨筆分類(64)

隨筆檔案(58)

文章分類(3)

文章檔案(3)

相冊

收藏夾(9)

C++零碎

好友

搜索

  •  

積分與排名

  • 積分 - 162553
  • 排名 - 163

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            在线播放不卡| 精品成人久久| 亚洲免费影院| 在线视频你懂得一区二区三区| 欧美成人一区二区在线| 一区二区三区自拍| 老司机一区二区三区| 久久久久网站| 最新成人av网站| 亚洲日本中文| 欧美日韩精品二区第二页| 中日韩美女免费视频网址在线观看 | 国产精品盗摄一区二区三区| 日韩一级精品| 中文无字幕一区二区三区| 国产精品人人做人人爽人人添| 亚洲欧美成aⅴ人在线观看| 亚洲一区精品在线| 激情婷婷欧美| 亚洲精品国产精品乱码不99| 国产精品二区三区四区| 久久久久久久高潮| 男女精品网站| 亚洲一区国产视频| 久久福利视频导航| 日韩天天综合| 欧美一区二区精品久久911| 亚洲第一精品电影| 一区二区三区四区五区视频| 国产一区二区你懂的| 欧美护士18xxxxhd| 国产精品第一区| 美女被久久久| 欧美午夜不卡| 麻豆av福利av久久av| 欧美日本国产精品| 久久精视频免费在线久久完整在线看| 老司机免费视频一区二区三区| 亚洲色在线视频| 久久免费视频观看| 新67194成人永久网站| 免费日韩av片| 久久精品综合一区| 国产精品v欧美精品v日韩 | 亚洲第一在线| 亚洲在线日韩| 亚洲毛片网站| 久久天天躁狠狠躁夜夜爽蜜月 | 精品69视频一区二区三区| 99精品国产在热久久| 1024亚洲| 欧美亚洲三区| 亚洲免费影视| 欧美日韩一级视频| 亚洲国产成人精品久久| 激情综合电影网| 亚洲女同精品视频| 亚洲午夜视频| 欧美日韩理论| 亚洲精品一区在线| 99精品99| 欧美久久一区| 亚洲国产91| 亚洲人成7777| 另类欧美日韩国产在线| 久久久久成人精品| 国产精品一区免费视频| 亚洲一级片在线看| 香蕉尹人综合在线观看| 国产精品亚洲不卡a| 亚洲一二三区视频在线观看| 亚洲亚洲精品三区日韩精品在线视频| 欧美精品国产精品日韩精品| 亚洲第一在线视频| 日韩视频欧美视频| 欧美日韩国产色视频| 日韩午夜激情| 亚洲系列中文字幕| 国产精品视频导航| 欧美亚洲网站| 老司机午夜精品视频| 亚洲国产视频直播| 欧美寡妇偷汉性猛交| 亚洲精品一区二区在线| 亚洲午夜视频| 国产亚洲视频在线| 久久久久久电影| 欧美激情国产精品| 夜夜爽av福利精品导航| 欧美午夜精品久久久久久孕妇| 中文av字幕一区| 久久久999精品| 亚洲国产一区二区精品专区| 欧美精品久久99| 亚洲一区欧美二区| 农村妇女精品| 99视频热这里只有精品免费| 国产精品久久久久三级| 欧美一区二区三区免费观看视频| 久久综合电影| 99这里只有久久精品视频| 国产精品影院在线观看| 久久精品一本| 99国产精品99久久久久久粉嫩| 久久国产精品电影| 最新日韩中文字幕| 国产精品嫩草99a| 久久久久久久综合| 亚洲天堂成人| 欧美国产一区二区| 午夜亚洲性色福利视频| 亚洲国产一区二区a毛片| 国产精品成人国产乱一区| 久久蜜桃香蕉精品一区二区三区| 日韩亚洲国产欧美| 免费成人黄色av| 欧美一级淫片播放口| 日韩亚洲欧美精品| 伊人久久大香线| 国产精品系列在线| 欧美区日韩区| 麻豆视频一区二区| 亚洲欧美在线网| 99热精品在线| 欧美成人精品一区二区| 久久国产日韩欧美| 亚洲女爱视频在线| 夜夜嗨av一区二区三区四区 | 欧美激情一区二区| 久久成人一区二区| 亚洲——在线| 国产精品99久久久久久有的能看| 免费精品99久久国产综合精品| 亚洲欧洲av一区二区三区久久| 亚洲乱码久久| 亚洲人精品午夜| 在线观看福利一区| 一区在线电影| 黑人巨大精品欧美一区二区小视频| 国产精品久久国产三级国电话系列| 欧美韩日精品| 欧美大片在线观看一区二区| 久久躁日日躁aaaaxxxx| 久久久久88色偷偷免费| 欧美一区在线视频| 午夜在线一区| 久久动漫亚洲| 久久久精品999| 久久婷婷av| 免费欧美电影| 欧美高清视频一二三区| 欧美激情视频在线免费观看 欧美视频免费一 | 久久精品亚洲热| 午夜国产不卡在线观看视频| 亚洲欧美成人综合| 性刺激综合网| 久久av红桃一区二区小说| 欧美一区综合| 久久蜜桃资源一区二区老牛 | 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 香蕉久久夜色精品国产| 欧美在线视频观看免费网站| 欧美在线观看一区二区三区| 午夜免费在线观看精品视频| 欧美一区二区三区男人的天堂| 午夜精品久久久久久99热| 午夜精品视频在线观看| 欧美在线观看天堂一区二区三区| 久久不射2019中文字幕| 久久女同精品一区二区| 欧美激情一区二区三区全黄 | 欧美在线视频日韩| 久久影院午夜片一区| 亚洲高清不卡| 亚洲网站在线观看| 久久久久成人精品| 欧美精品一级| 国产精品自拍在线| 在线精品一区| 亚洲在线观看视频网站| 久久影视三级福利片| 亚洲人成网站影音先锋播放| 亚洲自拍高清| 免费不卡在线观看av| 国产精品区一区二区三区| 亚洲第一偷拍| 香蕉亚洲视频| 亚洲国产裸拍裸体视频在线观看乱了 | 99精品视频一区| 久久精品论坛| 亚洲另类视频| 欧美一区二区三区婷婷月色 | 国产精品啊v在线| 在线播放一区| 亚洲欧美精品伊人久久| 女仆av观看一区| 亚洲影视综合| 欧美巨乳在线| 在线成人av.com| 欧美中文在线字幕|