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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sender.cpp

?? 一個開源的網(wǎng)絡(luò)開發(fā)庫ACE
?? CPP
字號:
/* -*- C++ -*- */
// sender.cpp,v 1.2 2002/02/18 16:01:56 crodrigu Exp

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


#include "ace/OS.h"
#include "ace/QoS/QoS_Session.h"
#include "ace/QoS/QoS_Session_Factory.h"
#include "ace/QoS/QoS_Session_Impl.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 "Sender_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[])
{  

  ACE_DEBUG ((LM_DEBUG,
              "Sender\n"));

  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 sender. So we fill in the sending QoS parameters.
       ACE_QoS ace_qos_sender;

       if (fill_ace_qos.fill_simplex_sender_qos (ace_qos_sender,
                                                 g_711) !=0)
         ACE_ERROR_RETURN ((LM_ERROR,
                            "Unable to fill simplex sender qos\n"),
                           -1);
       else
         ACE_DEBUG ((LM_DEBUG,
                     "Filled up the Sender QoS parameters\n"));
       
       // Opening a new Multicast Datagram. It is absolutely necessary that
       // the sender and the receiver subscribe to the same multicast
       // addresses to make sure the "multicast sessions" for the two are
       // the same. This is used to match the RESV<->PATH states.
       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_sender);
      
      // 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 sender. 
      qos_session->flags (ACE_QoS_Session::ACE_QOS_SENDER);
      
      ACE_QoS_Manager qos_manager = dgram_mcast_qos.qos_manager ();
      
      // Since we are using RSVP, it is imperative that the client
      // application have the option of supplying the source sender
      // port for the RSVP messages. A default will be chosen by the
      // ACE API if this is not done.
      qos_session->source_port (qos_util.source_port ());
      
      // 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_sender) == -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.
      Sender_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;
}







?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色噜噜夜夜夜综合网| 亚洲午夜免费电影| 欧美久久一二区| 99re这里只有精品6| 韩国欧美国产1区| 亚洲一区二区三区小说| 国产精品久久久久久久久免费相片| 日韩免费视频线观看| 91成人国产精品| 成人av在线资源网站| 国产精品2024| 色综合久久中文字幕综合网 | 日本成人在线不卡视频| 亚洲地区一二三色| 亚洲一级二级三级| 亚洲五码中文字幕| 天涯成人国产亚洲精品一区av| 一区二区三区精品久久久| 一区二区三区中文字幕| 亚洲丝袜制服诱惑| 亚洲一区二区三区四区在线观看| 一区二区三区四区乱视频| 亚洲一区二区av在线| 亚洲国产乱码最新视频| 日本aⅴ免费视频一区二区三区| 三级在线观看一区二区| 久久国内精品自在自线400部| 精品一区二区综合| 国产成人综合在线观看| jlzzjlzz亚洲女人18| 欧美性大战久久久久久久蜜臀| 欧美日韩一区二区三区四区| 日韩欧美综合在线| 欧美国产精品中文字幕| 亚洲精品自拍动漫在线| 婷婷久久综合九色国产成人| 麻豆精品一二三| 成人看片黄a免费看在线| av一区二区不卡| 在线看日韩精品电影| 日韩欧美国产午夜精品| 国产精品每日更新在线播放网址 | 综合久久久久久久| 亚洲综合色丁香婷婷六月图片| 免费人成网站在线观看欧美高清| 国产成人av电影在线| 色琪琪一区二区三区亚洲区| 精品国产污污免费网站入口| 亚洲欧美日韩在线| 激情图片小说一区| 欧美性色黄大片| 国产三级精品视频| 日韩国产欧美在线视频| av不卡一区二区三区| 欧美www视频| 亚洲日本乱码在线观看| 国产麻豆精品在线观看| 欧美日韩国产一二三| 国产精品你懂的| 久久97超碰国产精品超碰| 色婷婷av一区二区三区之一色屋| 26uuu精品一区二区在线观看| 亚洲免费观看高清在线观看| 国产精品一区免费在线观看| 67194成人在线观看| 亚洲精品免费在线观看| 国产成人免费9x9x人网站视频| 国产免费久久精品| 青青草国产精品亚洲专区无| 色成年激情久久综合| 国产欧美日产一区| 国产一区视频导航| 欧美一区二区三区日韩| 一区二区激情视频| proumb性欧美在线观看| 国产精品久久久久一区二区三区 | 日本中文字幕不卡| 在线区一区二视频| 亚洲丝袜另类动漫二区| 成人激情黄色小说| 国产精品亲子乱子伦xxxx裸| 国产一区二区三区在线观看免费| 欧美一区二区三区免费在线看| 一级特黄大欧美久久久| 色综合久久天天| 亚洲视频精选在线| 91麻豆视频网站| 亚洲欧美色图小说| 91成人免费在线| 亚洲国产精品精华液网站| 在线观看91视频| 亚洲一区二区三区在线看| 在线日韩av片| 亚洲成av人片一区二区梦乃| 欧美日韩免费高清一区色橹橹| 图片区小说区区亚洲影院| 精品视频一区三区九区| 日韩有码一区二区三区| 欧美成人一区二区三区| 国产精品一区二区久久不卡 | 国产高清在线观看免费不卡| 国产亚洲欧美在线| 成人免费的视频| 亚洲欧美日本韩国| 欧美日韩电影一区| 麻豆精品久久精品色综合| 久久久久国产精品厨房| 99久久精品国产毛片| 一区二区三区精品| 51午夜精品国产| 国产精品乡下勾搭老头1| 中文字幕久久午夜不卡| 欧美午夜免费电影| 黄页网站大全一区二区| 国产精品美女久久久久久2018| 日韩你懂的电影在线观看| 久久99精品国产麻豆婷婷| 日本一区二区三区在线不卡| 在线视频中文字幕一区二区| 麻豆国产精品777777在线| 国产精品乱人伦| 欧美日韩国产不卡| 国产精品18久久久久久vr| 亚洲精选免费视频| 久久久综合视频| 欧美伊人久久久久久久久影院 | 日韩高清欧美激情| 欧美国产成人精品| 91精品国产综合久久久久久| 成人精品亚洲人成在线| 日本不卡高清视频| 亚洲精品日日夜夜| www国产成人免费观看视频 深夜成人网| av电影在线观看一区| 极品美女销魂一区二区三区| 亚洲一区在线观看免费观看电影高清 | 日韩在线卡一卡二| 中文字幕中文在线不卡住| 制服.丝袜.亚洲.中文.综合| 成人a级免费电影| 久久99久久99精品免视看婷婷| 亚洲欧美偷拍卡通变态| 久久久精品2019中文字幕之3| 91九色最新地址| 成人手机在线视频| 国内外成人在线| 日本欧美在线看| 亚洲国产wwwccc36天堂| 亚洲日本一区二区三区| 欧美va亚洲va香蕉在线| 制服丝袜中文字幕一区| 欧美日韩国产欧美日美国产精品| 成人永久aaa| 国产老妇另类xxxxx| 午夜精品一区二区三区三上悠亚| 亚洲欧美另类在线| 国产精品久久国产精麻豆99网站| 精品少妇一区二区三区在线播放 | 日本午夜精品一区二区三区电影| 亚洲激情图片一区| 一区在线观看视频| 亚洲天堂久久久久久久| 中文字幕色av一区二区三区| 国产精品高潮呻吟久久| 国产精品美日韩| 亚洲另类中文字| 亚洲国产精品一区二区尤物区| 一区二区国产盗摄色噜噜| 成人欧美一区二区三区白人| 中文字幕一区二区三区视频| 中文字幕一区二区三区在线不卡 | 一级女性全黄久久生活片免费| 最新热久久免费视频| 亚洲免费看黄网站| 香蕉av福利精品导航| 五月天国产精品| 狠狠狠色丁香婷婷综合激情 | 国内精品伊人久久久久av影院| 麻豆成人久久精品二区三区红| 美女视频黄 久久| 国产精品自拍在线| 99天天综合性| 欧美性受极品xxxx喷水| 欧美精品三级在线观看| 精品视频一区二区不卡| 欧美成人一级视频| 国产精品每日更新在线播放网址| 亚洲黄色小视频| 热久久免费视频| 国产成人亚洲综合色影视| 91在线观看地址| 欧美一区二区久久| 国产欧美一区二区三区在线老狼| 国产日韩欧美激情| 亚洲激情在线激情| 国产主播一区二区| 在线一区二区视频| 久久综合九色综合欧美亚洲| 亚洲美腿欧美偷拍| 国内精品第一页|