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

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 閱讀(1614) 評(píng)論(0)  編輯 收藏 引用 所屬分類: ACE Farmeworks

<2007年12月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

常用鏈接

留言簿(4)

隨筆分類(64)

隨筆檔案(58)

文章分類(3)

文章檔案(3)

相冊(cè)

收藏夾(9)

C++零碎

好友

搜索

  •  

積分與排名

  • 積分 - 162058
  • 排名 - 163

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            国产一区二区精品丝袜| 欧美一级黄色录像| 亚洲免费影视第一页| 亚洲无限乱码一二三四麻| 一本色道久久加勒比88综合| 日韩天堂av| 亚洲在线成人精品| 久久xxxx| 欧美黄色大片网站| 99re6热在线精品视频播放速度| 久久久伊人欧美| 农夫在线精品视频免费观看| 亚洲高清免费在线| 91久久香蕉国产日韩欧美9色| 日韩午夜av在线| 亚洲欧美国产毛片在线| 另类专区欧美制服同性| 欧美日韩午夜| 国内视频一区| 亚洲视频一区二区免费在线观看| 久久激情网站| 亚洲国内自拍| 午夜精品视频网站| 欧美精品在欧美一区二区少妇| 国产欧美va欧美va香蕉在| 亚洲激情社区| 欧美在线观看网址综合| 亚洲精品1区2区| 欧美一区午夜精品| 欧美日韩一区二区国产| 亚洲国产视频直播| 久久国产精品电影| 亚洲美女毛片| 欧美 日韩 国产 一区| 国产欧美精品日韩| 亚洲小视频在线观看| 欧美福利电影在线观看| 欧美在线黄色| 国产女人精品视频| 亚洲综合电影| 亚洲欧洲精品一区| 葵司免费一区二区三区四区五区| 国产精品一级久久久| 一区二区三区久久久| 亚洲电影一级黄| 久久久久成人精品免费播放动漫| 国产精品久久久久久久久久免费| 99国产精品私拍| 亚洲大片在线| 免费不卡中文字幕视频| 亚洲第一精品久久忘忧草社区| 久久精品在线视频| 午夜精品区一区二区三| 国产精品自在欧美一区| 亚洲欧美中文字幕| 亚洲一区二区毛片| 国产精品入口夜色视频大尺度| 亚洲性视频h| 亚洲天堂av在线免费| 国产精品久久久久国产精品日日| 亚洲午夜精品久久久久久浪潮 | 久久成人18免费观看| 国产精品久久久久久久久久直播| 正在播放日韩| 亚洲小视频在线观看| 亚洲第一福利在线观看| 免费看亚洲片| 国产精品麻豆成人av电影艾秋| 99精品国产99久久久久久福利| 亚洲国产婷婷香蕉久久久久久99| 欧美刺激午夜性久久久久久久| 亚洲精品欧洲精品| 亚洲精品一区二区网址| 欧美视频一二三区| 久久国产精彩视频| 免费观看一区| 一区二区国产精品| 亚洲系列中文字幕| 激情综合久久| 最新国产精品拍自在线播放| 欧美日韩一区二区三区在线视频 | 欧美粗暴jizz性欧美20| 欧美不卡在线视频| 亚洲视频免费看| 午夜在线视频观看日韩17c| 激情久久久久久| 亚洲精品视频中文字幕| 国产精品亚洲产品| 欧美成人有码| 欧美视频不卡| 麻豆久久久9性大片| 欧美日本不卡视频| 久久久久久电影| 欧美日韩的一区二区| 久久国产精品久久w女人spa| 欧美激情精品久久久久久久变态| 亚洲欧美在线x视频| 久久综合久久久| 亚洲欧美国产高清| 欧美电影免费观看网站| 久久国产精品久久久| 欧美激情一区二区三区全黄| 久久精品国产91精品亚洲| 欧美日本中文字幕| 女人天堂亚洲aⅴ在线观看| 国产精品日产欧美久久久久| 亚洲高清久久久| 红桃视频国产一区| 亚洲一二三区在线观看| 亚洲理论在线| 久久色在线播放| 久久狠狠亚洲综合| 国产精品久久综合| 亚洲免费观看在线视频| 亚洲国产精品久久久久久女王| 亚洲欧美国产精品va在线观看| 一本色道久久88亚洲综合88| 久久夜色精品国产欧美乱| 久久精品五月| 国产一区二区| 香蕉久久夜色精品国产| 午夜精品电影| 国产精品久久久久9999吃药| 日韩视频欧美视频| 一本色道精品久久一区二区三区| 另类成人小视频在线| 蜜臀91精品一区二区三区| 午夜宅男欧美| 久久久久久久性| 国产美女一区二区| 日韩西西人体444www| 91久久久亚洲精品| 久久欧美肥婆一二区| 久久精视频免费在线久久完整在线看| 欧美午夜精品久久久久免费视| 亚洲精品免费网站| 亚洲视频一起| 国产精品免费福利| 亚洲专区一区二区三区| 欧美在线播放一区| 国产日韩欧美电影在线观看| 午夜精品av| 久久婷婷麻豆| 亚洲国产另类 国产精品国产免费| 久久久久久久久岛国免费| 久久在线播放| 最新中文字幕亚洲| 欧美日韩在线播放三区| 亚洲视频视频在线| 久久精品一区中文字幕| 亚洲国产黄色片| 欧美母乳在线| 午夜欧美精品久久久久久久| 久久人体大胆视频| 亚洲精品一区二区三区不| 欧美日韩四区| 午夜精品久久久久久久久| 老司机免费视频一区二区三区| 亚洲激情影院| 国产精品女主播一区二区三区| 欧美一级淫片aaaaaaa视频| 欧美1区2区| 亚洲性感激情| 精品成人一区| 欧美日本不卡视频| 亚洲欧洲av一区二区| 欧美激情一区二区| 亚洲欧美色婷婷| 亚洲娇小video精品| 国产精品日韩专区| 欧美大片91| 性欧美video另类hd性玩具| 欧美a级片网| 午夜精品婷婷| 日韩一级精品| 黑人操亚洲美女惩罚| 欧美日韩在线免费观看| 欧美尤物一区| 在线亚洲观看| 亚洲国产精品一区二区三区| 午夜精品久久久| 99热精品在线| 1024成人网色www| 国产日韩欧美在线播放| 欧美日本二区| 免费在线视频一区| 欧美在线视频观看| 亚洲午夜日本在线观看| 亚洲国产精品视频一区| 久久午夜色播影院免费高清| 亚洲一区自拍| 日韩亚洲欧美综合| 最新精品在线| 在线观看国产精品网站| 国产日韩欧美二区| 国产精品社区| 国产精品二区二区三区| 欧美日韩国产在线一区| 欧美激情亚洲激情| 欧美大香线蕉线伊人久久国产精品|