亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? receiver.cpp

?? 一個開源的網絡開發庫ACE
?? CPP
字號:
/* -*- C++ -*- */
// receiver.cpp,v 1.2 2002/02/18 16:01:56 crodrigu Exp

// ============================================================================
//
// = LIBRARY
//    ACE_wrappers/examples/QOS
//
// = FILENAME
//    server.cpp
//
// = AUTHOR
//    Vishal Kachroo <vishal@cs.wustl.edu>
//
// ============================================================================

#define QOSEVENT_MAIN

#include "ace/OS.h"
#include "ace/QoS/QoS_Session.h"
#include "ace/QoS/QoS_Session_Factory.h"
#include "ace/QoS/QoS_Decorator.h"
#include "ace/QoS/SOCK_Dgram_Mcast_QoS.h"

#include "QoS_Util.h"
#include "Fill_ACE_QoS.h"
#include "QoS_Signal_Handler.h"
#include "Receiver_QoS_Event_Handler.h"
    
// To open QOS sockets administrative access is required on the
// machine.  Fill in default values for QoS structure.  The default
// values were simply choosen from existing QOS templates available
// via WSAGetQosByName.  Notice that ProviderSpecific settings are
// being allowed when picking the "default" template but not for
// "well-known" QOS templates.  Also notice that since data is only
// flowing from sender to receiver, different flowspecs are filled in
// depending upon whether this application is acting as a sender or
// receiver.


// This function fills up the ACE_QoS_Params with the supplied iovec
// and ACE_QoS.

int
FillQoSParams (ACE_QoS_Params &qos_params,
               iovec* iov, 
               ACE_QoS* qos)
{
  qos_params.callee_data (iov);
  qos_params.caller_data (0);
  qos_params.socket_qos (qos);
  qos_params.group_socket_qos (0);
  qos_params.flags (ACE_JL_BOTH);

  return 0;
}

int
main (int argc, char * argv[])
{  

  QoS_Util qos_util(argc, argv);

  if (qos_util.parse_args () == -1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       "Error in parsing args\n"),
                      -1);

  // This is a multicast application.
  if (qos_util.multicast_flag ())
    {
       Fill_ACE_QoS  fill_ace_qos;

       // The application adds the flow specs that it wants into the
       // Fill_ACE_QoS. The Fill_ACE_QoS indexes the flow specs by the
       // flow spec names. Here the new flowspec being added is g_711.
       ACE_CString g_711 ("g_711");

       switch (fill_ace_qos.map ().bind (g_711,
                                         new ACE_Flow_Spec (9200,
                                                            708,
                                                            18400,
                                                            0,
                                                            0,
                                                            ACE_SERVICETYPE_CONTROLLEDLOAD,
                                                            368,
                                                            368,
                                                            25,
                                                            1)))
         {
         case 1 : 
           ACE_ERROR_RETURN ((LM_ERROR,
                              "Unable to bind the new flow spec\n"
                              "The Flow Spec name already exists\n"),
                             -1);
           break;
         case -1 :
           ACE_ERROR_RETURN ((LM_ERROR,
                              "Unable to bind the new flow spec\n"),
                             -1);
           break;
         }
    
       ACE_DEBUG ((LM_DEBUG,
                   "g_711 Flow Spec bound successfully\n"));

       // This is a receiver. So we fill in the receiving QoS parameters.
       ACE_QoS ace_qos_receiver;
       if (fill_ace_qos.fill_simplex_receiver_qos (ace_qos_receiver,
                                                   g_711) !=0)
         ACE_ERROR_RETURN ((LM_ERROR,
                            "Unable to fill simplex receiver qos\n"),
                           -1);
       else
         ACE_DEBUG ((LM_DEBUG,
                     "Filled up the Receiver QoS parameters\n"));

      // Opening a new Multicast Datagram.
      ACE_SOCK_Dgram_Mcast_QoS dgram_mcast_qos;
      
      // Multicast Session Address specified by user at command line.
      // If this address is not specified, 
      // <localhost:ACE_DEFAULT_MULTICAST_PORT> is assumed. 
      ACE_INET_Addr mult_addr (*(qos_util.mult_session_addr ()));
      
      // Fill the ACE_QoS_Params to be passed to the <ACE_OS::join_leaf>
      // through subscribe.

      ACE_QoS_Params qos_params;
      FillQoSParams (qos_params, 0, &ace_qos_receiver);

      // Create a QoS Session Factory.
      ACE_QoS_Session_Factory session_factory;

      // Ask the factory to create a QoS session.
      ACE_QoS_Session *qos_session = 
        session_factory.create_session ();

      // Create a destination address for the QoS session. The same
      // address should be used for the subscribe call later. A copy
      // is made below only to distinguish the two usages of the dest
      // address.

      ACE_INET_Addr dest_addr (mult_addr);

      // A QoS session is defined by the 3-tuple [DestAddr, DestPort,
      // Protocol]. Initialize the QoS session.
      if (qos_session->open (mult_addr,
                             IPPROTO_UDP) == -1)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "Error in opening the QoS session\n"),
                          -1);
      else
        ACE_DEBUG ((LM_DEBUG,
                    "QoS session opened successfully\n"));

      // The following call opens the Dgram_Mcast and calls the
      // <ACE_OS::join_leaf> with the qos_params supplied here. Note
      // the QoS session object is passed into this call. This
      // subscribes the underlying socket to the passed in QoS
      // session. For joining multiple multicast sessions, the
      // following subscribe call should be made with different
      // multicast addresses and a new QoS session object should be
      // passed in for each such call. The QoS session objects can be
      // created only through the session factory. Care should be
      // taken that the mult_addr for the subscribe() call matches the
      // dest_addr of the QoS session object. If this is not done, the
      // subscribe call will fail. A more abstract version of
      // subscribe will be added that constrains the various features
      // of GQoS like different flags etc.
      
      if (dgram_mcast_qos.subscribe (mult_addr,
                                     qos_params,
                                     1,
                                     0,
                                     AF_INET,
                                     // ACE_FROM_PROTOCOL_INFO,
                                     0,
                                     0, // ACE_Protocol_Info,
                                     0,
                                     ACE_OVERLAPPED_SOCKET_FLAG 
                                     | ACE_FLAG_MULTIPOINT_C_LEAF 
                                     | ACE_FLAG_MULTIPOINT_D_LEAF,
                                     qos_session) == -1)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "Error in subscribe\n"),
                          -1);
      else
        ACE_DEBUG ((LM_DEBUG,
                    "Dgram_Mcast subscribe succeeds \n"));

      int nIP_TTL = 25;
      char achInBuf [BUFSIZ];
      u_long dwBytes;
  
      // Should this be abstracted into QoS objects ?? Doesnt seem to have
      // to do anything directly with QoS.
      if (ACE_OS::ioctl (dgram_mcast_qos.get_handle (), // Socket.
                         ACE_SIO_MULTICAST_SCOPE, // IO control code.
                         &nIP_TTL, // In buffer.
                         sizeof (nIP_TTL), // Length of in buffer.
                         achInBuf, // Out buffer.
                         BUFSIZ, // Length of Out buffer.
                         &dwBytes, // bytes returned.
                         0, // Overlapped.
                         0) == -1) // Func.
        ACE_ERROR ((LM_ERROR,
                    "Error in Multicast scope ACE_OS::ioctl() \n"));
      else
        ACE_DEBUG ((LM_DEBUG,
                    "Setting TTL with Multicast scope ACE_OS::ioctl call succeeds \n"));
      
      int bFlag = 0;
      
      // Should this be abstracted into QoS objects ?? Doesnt seem to have
      // to do anything directly with QoS.
      if (ACE_OS::ioctl (dgram_mcast_qos.get_handle (), // Socket.
                         ACE_SIO_MULTIPOINT_LOOPBACK, // IO control code.
                         &bFlag, // In buffer.
                         sizeof (bFlag), // Length of in buffer.
                         achInBuf, // Out buffer.
                         BUFSIZ, // Length of Out buffer.
                         &dwBytes, // bytes returned.
                         0, // Overlapped.
                         0) == -1) // Func.
        ACE_ERROR ((LM_ERROR,
                    "Error in Loopback ACE_OS::ioctl() \n"));
      else
        ACE_DEBUG ((LM_DEBUG,
                    "Disable Loopback with ACE_OS::ioctl call succeeds \n"));
      
      // This is a receiver. 
      qos_session->flags (ACE_QoS_Session::ACE_QOS_RECEIVER);
      
      ACE_QoS_Manager qos_manager = dgram_mcast_qos.qos_manager ();
      
      // Set the QoS for the session. Replaces the ioctl () call that
      // was being made previously.
      if (qos_session->qos (&dgram_mcast_qos,
                            &qos_manager,
                            ace_qos_receiver) == -1)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "Unable to set QoS\n"),
                          -1);
      else
        ACE_DEBUG ((LM_DEBUG,
                    "Setting QOS succeeds.\n"));

      // Register a signal handler that helps to gracefully close the
      // open QoS sessions.
      QoS_Signal_Handler qos_signal_handler (qos_session);
      
      // Register the usual SIGINT signal handler with the Reactor for
      // the application to gracefully release the QoS session and
      // shutdown.
      if (ACE_Reactor::instance ()->register_handler 
          (SIGINT, &qos_signal_handler) == -1)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "Error in registering the Signal Handler.\n"),
                          -1);

      // Handler to process QoS and Data events for the reciever.
      Receiver_QoS_Event_Handler qos_event_handler (dgram_mcast_qos,
                                                    qos_session);

      // Decorate the above handler with QoS functionality. 
      ACE_QoS_Decorator qos_decorator (&qos_event_handler,
                                       qos_session);

      // Initialize the Decorator.
      if (qos_decorator.init () != 0)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "QoS Decorator init () failed.\n"),
                          -1);

      // Register the decorated Event Handler with the Reactor.
      if (ACE_Reactor::instance ()->register_handler (&qos_decorator,
                                                      ACE_Event_Handler::QOS_MASK |
                                                      ACE_Event_Handler::READ_MASK) == -1)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "Error in registering the Decorator with the Reactor\n"),
                          -1);

      
      // Start the event loop.
      ACE_DEBUG ((LM_DEBUG,
                  "Running the Event Loop ... \n"));
      
      ACE_Reactor::instance ()->run_event_loop ();
      
      ACE_DEBUG ((LM_DEBUG,
                  "(%P|%t) shutting down server logging daemon\n"));
    }
  else
    ACE_DEBUG ((LM_DEBUG,
                "Specify a -m option for multicast application\n"));
  return 0;
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产尿小便嘘嘘| 成人精品电影在线观看| 国产精品一区在线| 色哟哟国产精品| 精品国产乱码久久久久久浪潮| 中文字幕乱码一区二区免费| 日韩国产在线一| 成人看片黄a免费看在线| 91精品国产综合久久蜜臀| 国产精品不卡在线| 久久国产精品72免费观看| 日本韩国欧美一区二区三区| 国产午夜亚洲精品羞羞网站| 日韩国产欧美在线观看| 99国产欧美另类久久久精品| 亚洲精品一区二区精华| 视频一区二区中文字幕| 欧美中文字幕一区二区三区| 中文字幕在线不卡一区| 国产在线精品一区二区三区不卡 | 丝瓜av网站精品一区二区 | 中文字幕免费不卡| 国内成+人亚洲+欧美+综合在线| 欧美精品久久99| 亚洲综合在线五月| 99re这里只有精品6| 欧美国产一区二区| 国产一区三区三区| 精品久久人人做人人爱| 天天影视色香欲综合网老头| 91免费看片在线观看| 1024成人网色www| 成人性色生活片免费看爆迷你毛片| 3d动漫精品啪啪一区二区竹菊| 一区二区三区毛片| 欧美中文字幕亚洲一区二区va在线| 亚洲va欧美va人人爽| 色综合一个色综合亚洲| 中文字幕中文字幕一区二区| 成人免费av资源| 国产精品美女www爽爽爽| 丁香激情综合五月| 自拍偷自拍亚洲精品播放| 99精品黄色片免费大全| 亚洲精选免费视频| 欧美三区在线视频| 水野朝阳av一区二区三区| 欧美精品第一页| 蜜桃一区二区三区四区| 日韩精品一区二区三区在线播放| 日韩不卡手机在线v区| 欧美一区二区三区视频在线| 蜜臀av一区二区| 久久久噜噜噜久噜久久综合| 国产电影一区二区三区| 亚洲视频 欧洲视频| 欧美在线免费视屏| 麻豆成人av在线| 欧美国产禁国产网站cc| 99精品视频一区| 午夜成人在线视频| 精品国产乱子伦一区| 成人精品一区二区三区四区| 亚洲精品一二三区| 欧美一三区三区四区免费在线看| 日本强好片久久久久久aaa| 久久久欧美精品sm网站| 99久久久久免费精品国产| 亚洲午夜视频在线观看| 日韩小视频在线观看专区| 成人黄色软件下载| 日韩电影免费一区| 中文字幕一区二区三区在线观看| 欧美日韩在线播放三区四区| 国产精品12区| 亚洲国产成人av网| 国产日韩欧美精品一区| 欧美日韩久久一区| 成人在线视频首页| 蜜桃视频第一区免费观看| 中文字幕中文在线不卡住| 在线电影欧美成精品| 成人av一区二区三区| 蜜桃视频在线一区| 亚洲综合色噜噜狠狠| 久久久五月婷婷| 日韩午夜小视频| 日本高清不卡一区| 国产伦精一区二区三区| 一区二区三区蜜桃| 亚洲国产精品99久久久久久久久| 欧美伦理影视网| 91麻豆成人久久精品二区三区| 免费看欧美女人艹b| 亚洲码国产岛国毛片在线| 精品成人一区二区三区四区| 在线观看欧美精品| 北岛玲一区二区三区四区| 久久aⅴ国产欧美74aaa| 天天操天天色综合| 亚洲免费伊人电影| 国产精品美女久久福利网站| 亚洲精品在线观| 日韩一区二区中文字幕| 欧美日韩亚洲另类| 99久久免费国产| 国产一区二区成人久久免费影院| 亚洲成人一区在线| 亚洲欧美福利一区二区| 国产亚洲精品中文字幕| 精品美女一区二区三区| 欧美日韩aaaaa| 欧美三级午夜理伦三级中视频| 色综合中文字幕| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 夜夜嗨av一区二区三区网页 | 欧美一级xxx| 国产精品亚洲专一区二区三区| 精品免费一区二区三区| 久久午夜免费电影| 日韩一区二区三免费高清| 欧美日韩高清一区二区不卡| 91成人免费网站| 欧美亚洲国产一卡| 欧美最猛黑人xxxxx猛交| 色爱区综合激月婷婷| 欧美性色黄大片| 91精品国产品国语在线不卡| 欧美一区二区三区爱爱| 欧美精品一区二区久久久| 日韩视频免费直播| 久久老女人爱爱| 国产精品激情偷乱一区二区∴| 亚洲国产高清aⅴ视频| 中文字幕一区免费在线观看| 专区另类欧美日韩| 亚洲综合一二三区| 日本va欧美va精品发布| 国产一区二区在线电影| 丰满放荡岳乱妇91ww| 色就色 综合激情| 欧美一区日本一区韩国一区| 欧美精品一区二区三区蜜臀| 欧美国产日本视频| 亚洲第一在线综合网站| 蜜臀久久99精品久久久久宅男 | 欧美日韩一卡二卡| 亚洲精品一线二线三线无人区| 国产精品日韩成人| 亚洲国产视频在线| 国产一区在线看| 91免费精品国自产拍在线不卡| 欧美电影一区二区三区| 国产调教视频一区| 亚洲一区二区三区美女| 狠狠色狠狠色综合系列| 91久久香蕉国产日韩欧美9色| 91精品欧美福利在线观看| 国产精品视频麻豆| 日韩av不卡在线观看| 成人精品视频一区二区三区| 欧美精品免费视频| 国产精品第一页第二页第三页| 性感美女久久精品| 成人美女视频在线看| 91精品国产欧美一区二区| 亚洲色图欧洲色图| 国内国产精品久久| 欧美精选在线播放| 国产精品久久久久久久久晋中| 青娱乐精品在线视频| 色综合天天性综合| 国产无一区二区| 蜜臀av性久久久久av蜜臀妖精 | 欧美一激情一区二区三区| 亚洲人成精品久久久久| 久久99久久久久| 亚洲欧美日韩国产一区二区三区| 色综合久久久久综合体| 一区二区三区不卡视频| 激情都市一区二区| 欧美另类高清zo欧美| 国产精品久久久久婷婷二区次| 美女任你摸久久| 欧美美女一区二区| 亚洲免费观看高清完整版在线观看| 国产麻豆91精品| 爽好久久久欧美精品| 91小视频在线| 国产精品天美传媒沈樵| 91小视频在线观看| 久久精品亚洲一区二区三区浴池| 丝袜美腿亚洲色图| 欧美日韩国产三级| 亚洲综合一区二区精品导航| 色综合中文字幕国产| 精品女同一区二区| 蜜桃视频在线观看一区| 欧美老人xxxx18| 亚洲午夜久久久久中文字幕久|