• <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>
            隨筆 - 298  文章 - 377  trackbacks - 0
            <2025年5月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(34)

            隨筆分類

            隨筆檔案

            文章檔案

            相冊

            收藏夾

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            1、創建IOCP

            ACE_WIN32_Proactor::ACE_WIN32_Proactor (size_t number_of_threads,

                                                    int used_with_reactor_event_loop)

             : completion_port_ (0),

                // This *MUST* be 0, *NOT* ACE_INVALID_HANDLE !!!

                number_of_threads_ (static_cast<DWORD> (number_of_threads)),

                used_with_reactor_event_loop_ (used_with_reactor_event_loop)

            {

             // Create the completion port.

             this->completion_port_ = ::CreateIoCompletionPort (INVALID_HANDLE_VALUE,

                                                                 0,

                                                                 0,

                                                                 this->number_of_threads_);

            //...

            }

            2、將一個句柄同完成端口關聯到一起

            int

            ACE_WIN32_Proactor::register_handle (ACE_HANDLE handle,

                                                 const void *completion_key)

            {

            #if defined (_MSC_VER) && (_MSC_VER < 1300)

             ULONG comp_key (reinterpret_cast<ULONG> (completion_key));

            #else

              ULONG_PTR comp_key (reinterpret_cast<ULONG_PTR> (completion_key));

            #endif

             

             // No locking is needed here as no state changes.

             ACE_HANDLE cp = ::CreateIoCompletionPort (handle,

                                                        this->completion_port_,

                                                        comp_key,

                                                        this->number_of_threads_);

            //...

            }

             

             

             

            3、投遞一個(或多個)異步操作

            4、在完成端口上等待

            int

            ACE_WIN32_Proactor::handle_events (unsigned long milli_seconds)

            {

              ACE_OVERLAPPED *overlapped = 0;

              u_long bytes_transferred = 0;

            #if defined (_MSC_VER) && (_MSC_VER < 1300)

              ULONG completion_key = 0;

            #else

              ULONG_PTR completion_key = 0;

            #endif

             

              // Get the next asynchronous operation that completes

              BOOL result = ::GetQueuedCompletionStatus (this->completion_port_,

                                                         &bytes_transferred,

                                                         &completion_key,

                                                         &overlapped,

                                                         milli_seconds);

            //Check errors

             

            //Execute the completion handler

                this->application_specific_code (asynch_result,

                                                   static_cast<size_t> (bytes_transferred),

                                                   (void *) completion_key,

                                                   result_err);

              return 1;

            }

             

             

            posted on 2007-08-17 12:01 聶文龍 閱讀(392) 評論(0)  編輯 收藏 引用 所屬分類: net work
            亚洲国产精品久久久天堂| 国产精品99久久久久久宅男小说| 久久天天躁夜夜躁狠狠躁2022| 蜜桃麻豆WWW久久囤产精品| 99久久99久久久精品齐齐| 色噜噜狠狠先锋影音久久| 伊人热热久久原色播放www| 久久99精品久久久久久hb无码| 欧美久久精品一级c片片| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | AAA级久久久精品无码区| 亚洲国产高清精品线久久 | 青草久久久国产线免观| 亚洲国产精品无码久久98| 久久国产视频网| 99久久婷婷免费国产综合精品| 久久综合狠狠综合久久97色| 久久青草国产手机看片福利盒子| 无码8090精品久久一区| 久久亚洲精品视频| 国产午夜福利精品久久2021 | 久久久久人妻精品一区二区三区| 久久99精品免费一区二区| 久久99国产精品久久99果冻传媒 | 五月丁香综合激情六月久久| 手机看片久久高清国产日韩| 国产高潮国产高潮久久久91| 97久久精品午夜一区二区| 老色鬼久久亚洲AV综合| 亚洲中文久久精品无码ww16 | 亚洲七七久久精品中文国产| 99热都是精品久久久久久| 国产精品视频久久久| 久久综合中文字幕| 久久99精品国产99久久| 国产三级久久久精品麻豆三级| 奇米综合四色77777久久| 久久Av无码精品人妻系列| 91视频国产91久久久| 99久久精品免费| 老男人久久青草av高清|