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

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

?? sender.cpp

?? ace開發環境 用來開發網絡程序 其運用了設計模式、多平臺、C++等多種知識
?? CPP
字號:
/* -*- C++ -*- */// $Id: sender.cpp 62806 2004-12-16 13:48:43Z jwillemsen $// ============================================================================//// = LIBRARY//    ACE_wrappers/examples/QOS//// = FILENAME//    client.cpp//// = AUTHOR//    Vishal Kachroo <vishal@cs.wustl.edu>//// ============================================================================#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.intFillQoSParams (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;}intACE_TMAIN (int argc, ACE_TCHAR * 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;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色电影在线| 夜夜嗨av一区二区三区网页| 亚洲一区二区三区中文字幕在线| bt欧美亚洲午夜电影天堂| 精品一区二区三区免费| 777久久久精品| 精品一区二区三区在线观看国产| 日韩精品综合一本久道在线视频| 久久66热偷产精品| 国产精品免费视频观看| 色妞www精品视频| 婷婷久久综合九色综合伊人色| 欧美精品欧美精品系列| 麻豆91免费看| 国产精品毛片大码女人| 色狠狠一区二区| 免费成人你懂的| 国产日韩欧美综合一区| 色婷婷久久久亚洲一区二区三区 | 91麻豆国产精品久久| 一区二区三区国产豹纹内裤在线| 欧美巨大另类极品videosbest | 欧美亚州韩日在线看免费版国语版| 一区二区三区在线观看动漫| 欧美一级高清片| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 国产精品午夜免费| 欧洲一区二区三区在线| 久久激情综合网| 亚洲欧美日韩国产另类专区| 日韩亚洲欧美高清| 99久久国产免费看| 免费在线观看一区二区三区| 中文字幕一区二区三| 4438x亚洲最大成人网| 不卡av电影在线播放| 日韩福利电影在线| 亚洲欧美日韩在线不卡| 亚洲精品一区二区在线观看| 91激情五月电影| 国产成人在线影院| 日本不卡123| 樱桃视频在线观看一区| 精品国产三级电影在线观看| 欧美图区在线视频| 99久久久国产精品| 国产一区在线看| 爽好多水快深点欧美视频| 国产精品女同互慰在线看| 欧美videos中文字幕| 一本色道久久综合亚洲91 | 亚洲男同性视频| 亚洲欧美怡红院| 国产1区2区3区精品美女| 91官网在线免费观看| 激情综合色综合久久| 亚洲chinese男男1069| 中文字幕在线不卡一区二区三区 | 免费观看在线综合| 亚洲最大的成人av| 中文字幕在线一区| 国产丝袜美腿一区二区三区| 日韩视频中午一区| 91成人网在线| 91在线视频观看| 国产 欧美在线| 国产乱子伦一区二区三区国色天香| 日韩电影在线一区| 亚洲成人黄色小说| 亚洲电影在线免费观看| 亚洲自拍偷拍九九九| 欧美激情中文不卡| 欧美国产日韩精品免费观看| 久久久久久电影| 久久影院电视剧免费观看| 精品剧情在线观看| 久久一日本道色综合| 久久精品日产第一区二区三区高清版 | 亚洲福利视频一区二区| 一区二区三区在线视频播放| 亚洲日本在线a| 一区二区三区四区亚洲| 一区二区三区欧美亚洲| 一区二区三区波多野结衣在线观看| 亚洲人成精品久久久久久| 国产精品久久久久久久久免费樱桃| 中文字幕精品一区二区精品绿巨人 | 久久亚洲免费视频| 日本一区二区三区高清不卡| 国产精品亲子乱子伦xxxx裸| 中文字幕中文乱码欧美一区二区| 亚洲伦在线观看| 亚洲成av人片www| 美女视频一区二区三区| 国产老女人精品毛片久久| 成人黄色国产精品网站大全在线免费观看| av亚洲产国偷v产偷v自拍| 欧美中文字幕久久| 欧美一级在线视频| 久久久www成人免费无遮挡大片| 国产欧美va欧美不卡在线| 一区二区三区在线免费播放| 日韩精品每日更新| 国产一区二区三区精品视频| jlzzjlzz亚洲女人18| 欧美日韩亚洲不卡| 久久久.com| 亚洲国产成人av网| 黑人精品欧美一区二区蜜桃| av动漫一区二区| 欧美久久一区二区| 国产无人区一区二区三区| 亚洲中国最大av网站| 日本成人在线不卡视频| 成人av电影在线观看| 欧美日韩精品一二三区| 日本一区免费视频| 水蜜桃久久夜色精品一区的特点| 国产高清不卡一区| 欧美日韩免费视频| 欧美韩国日本综合| 日韩在线播放一区二区| 成人午夜在线免费| 欧美精品乱码久久久久久| 欧美国产日韩亚洲一区| 日韩国产在线观看| 91香蕉视频黄| 久久久噜噜噜久久人人看| 亚洲mv在线观看| www.66久久| 久久久蜜臀国产一区二区| 亚洲国产三级在线| jiyouzz国产精品久久| 日韩一区二区精品| 夜夜嗨av一区二区三区四季av| 国产精品白丝jk白祙喷水网站 | 国产美女视频91| 欧美日韩国产一二三| 中文字幕亚洲一区二区va在线| 老司机午夜精品| 欧美色综合影院| 亚洲欧美日韩在线播放| 国产一区二区三区免费| 日韩三级av在线播放| 一区二区免费看| 色综合天天天天做夜夜夜夜做| 精品国产一区二区三区四区四| 午夜久久久影院| 欧美影视一区在线| 亚洲精品国产精华液| 成人午夜视频网站| 国产欧美一二三区| 国产乱码精品一区二区三区av| 日韩视频在线你懂得| 日日夜夜精品视频天天综合网| 欧美亚洲高清一区二区三区不卡| 日韩美女视频一区| av亚洲产国偷v产偷v自拍| 欧美国产精品v| 高清不卡一区二区| 国产欧美日产一区| 国产91丝袜在线观看| 久久精品这里都是精品| 国产一区视频在线看| 久久精品一区四区| 不卡一区二区三区四区| 欧美韩国一区二区| 9人人澡人人爽人人精品| 国产精品久久久久久久久快鸭| 国产成人精品三级麻豆| 国产精品免费aⅴ片在线观看| 岛国av在线一区| 亚洲区小说区图片区qvod| 97se亚洲国产综合自在线不卡| 中文字幕永久在线不卡| 91论坛在线播放| 亚洲午夜久久久久久久久电影网| 欧美日韩亚洲不卡| 久久国产剧场电影| 国产欧美一区二区三区在线老狼| 成人黄色一级视频| 亚洲乱码中文字幕| 欧美日韩中文国产| 蜜臀国产一区二区三区在线播放| 日韩一级片在线播放| 国产乱对白刺激视频不卡| 国产精品久久精品日日| 欧美午夜在线一二页| 久久不见久久见免费视频7| 国产日产欧美一区二区三区| av在线播放不卡| 亚洲国产精品久久一线不卡| 日韩一区二区在线观看视频播放 | 成人免费观看视频| 亚洲黄色性网站| 欧美一级夜夜爽| 丁香激情综合国产| 五月天网站亚洲| 精品国产伦一区二区三区观看方式| 成人国产精品免费观看动漫|