diff options
author | vishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-12-29 00:31:25 +0000 |
---|---|---|
committer | vishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-12-29 00:31:25 +0000 |
commit | 595c59533560ee21bfdf47800f5108b4d71f0fe6 (patch) | |
tree | bd962c7b2906de0a6d9e6532cb4560069521f147 /examples | |
parent | f8442f755814bd830124e3cf0746dc9c43fc5f20 (diff) | |
download | ATCD-595c59533560ee21bfdf47800f5108b4d71f0fe6.tar.gz |
*** empty log message ***
Diffstat (limited to 'examples')
-rw-r--r-- | examples/QOS/Receiver_QOS_Event_Handler.cpp | 8 | ||||
-rw-r--r-- | examples/QOS/Receiver_QOS_Event_Handler.h | 60 | ||||
-rw-r--r-- | examples/QOS/server.cpp | 77 |
3 files changed, 74 insertions, 71 deletions
diff --git a/examples/QOS/Receiver_QOS_Event_Handler.cpp b/examples/QOS/Receiver_QOS_Event_Handler.cpp index e0070cd7880..ea0844b0500 100644 --- a/examples/QOS/Receiver_QOS_Event_Handler.cpp +++ b/examples/QOS/Receiver_QOS_Event_Handler.cpp @@ -22,7 +22,7 @@ ACE_QOS_Event_Handler::ACE_QOS_Event_Handler (void) } ACE_QOS_Event_Handler::ACE_QOS_Event_Handler (const ACE_SOCK_Dgram_Mcast &dgram_mcast, - ACE_QoS_Session *qos_session) + ACE_QoS_Session *qos_session) : dgram_mcast_ (dgram_mcast), qos_session_ (qos_session) { @@ -57,9 +57,9 @@ ACE_QOS_Event_Handler::handle_qos (ACE_HANDLE) // Win2K example. if (this->qos_session_->update_qos () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Error in updating QoS\n"), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + "Error in updating QoS\n"), + -1); else ACE_DEBUG ((LM_DEBUG, " Updating QOS succeeds.\n")); diff --git a/examples/QOS/Receiver_QOS_Event_Handler.h b/examples/QOS/Receiver_QOS_Event_Handler.h index ddcfc18cfd2..d17e2c711fe 100644 --- a/examples/QOS/Receiver_QOS_Event_Handler.h +++ b/examples/QOS/Receiver_QOS_Event_Handler.h @@ -25,35 +25,35 @@ ACE_RCSID(Receiver_QOS_Event_Handler, Receiver_QOS_Event_Handler, "$Id$") -class ACE_QOS_Event_Handler : public ACE_Event_Handler -{ -public: - // = Initialization and Termination methods. - ACE_QOS_Event_Handler (void); - // Constructor. - - ACE_QOS_Event_Handler::ACE_QOS_Event_Handler (const ACE_SOCK_Dgram_Mcast &dgram_mcast, - ACE_QoS_Session *qos_session); - // Constructor. - - ~ACE_QOS_Event_Handler (void); - // Destructor. - - virtual ACE_HANDLE get_handle (void) const; - // Override this to return the handle of the Dgram_Mcast - // that we are using. - - virtual int handle_qos (ACE_HANDLE fd); - // Handles a QOS event. Right now, just - // prints a message. - - virtual int handle_input (ACE_HANDLE fd); - // Handles a READ event. - -private: - ACE_SOCK_Dgram_Mcast dgram_mcast_; - ACE_INET_Addr remote_addr_; - ACE_QoS_Session *qos_session_; -}; + class ACE_QOS_Event_Handler : public ACE_Event_Handler + { + public: + // = Initialization and Termination methods. + ACE_QOS_Event_Handler (void); + // Constructor. + + ACE_QOS_Event_Handler::ACE_QOS_Event_Handler (const ACE_SOCK_Dgram_Mcast &dgram_mcast, + ACE_QoS_Session *qos_session); + // Constructor. + + ~ACE_QOS_Event_Handler (void); + // Destructor. + + virtual ACE_HANDLE get_handle (void) const; + // Override this to return the handle of the Dgram_Mcast + // that we are using. + + virtual int handle_qos (ACE_HANDLE fd); + // Handles a QOS event. Right now, just + // prints a message. + + virtual int handle_input (ACE_HANDLE fd); + // Handles a READ event. + + private: + ACE_SOCK_Dgram_Mcast dgram_mcast_; + ACE_INET_Addr remote_addr_; + ACE_QoS_Session *qos_session_; + }; #endif /* RECEIVER_QOS_EVENT_HANDLER_H */ diff --git a/examples/QOS/server.cpp b/examples/QOS/server.cpp index 164482798aa..ea80ac435ea 100644 --- a/examples/QOS/server.cpp +++ b/examples/QOS/server.cpp @@ -214,36 +214,39 @@ main (int argc, char * argv[]) // Create a QoS Session Factory. ACE_QoS_Session_Factory session_factory; - // Ask the factory to create a QoS session. This could be RAPI or GQoS - // based on the parameter passed. + // Ask the factory to create a QoS session. This could be RAPI or + // GQoS based on the parameter passed. ACE_QoS_Session *qos_session = - session_factory.create_session (ACE_QoS_Session_Factory::ACE_GQOS_SESSION); + session_factory.create_session (ACE_QoS_Session_Factory::ACE_GQOS_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. + // 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. + // 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); + IPPROTO_UDP) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "Error in opening the QoS session\n"), + -1); // 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. + // 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.subscribe (mult_addr, qos_params, @@ -256,7 +259,7 @@ main (int argc, char * argv[]) ACE_OVERLAPPED_SOCKET_FLAG | ACE_FLAG_MULTIPOINT_C_LEAF | ACE_FLAG_MULTIPOINT_D_LEAF, - qos_session) == -1) + qos_session) == -1) ACE_ERROR_RETURN ((LM_ERROR, "Error in subscribe\n"), -1); @@ -268,8 +271,8 @@ main (int argc, char * argv[]) char achInBuf [BUFSIZ]; u_long dwBytes; - // Should this be abstracted into QoS objects ?? Doesnt seem to - // have to do anything directly with QoS. + // Should this be abstracted into QoS objects ?? Doesnt seem to have + // to do anything directly with QoS. if (ACE_OS::ioctl (dgram_mcast.get_handle (), // Socket. ACE_SIO_MULTICAST_SCOPE, // IO control code. &nIP_TTL, // In buffer. @@ -287,8 +290,8 @@ main (int argc, char * argv[]) int bFlag = FALSE; - // Should this be abstracted into QoS objects ?? Doesnt seem to - // have to do anything directly with QoS. + // Should this be abstracted into QoS objects ?? Doesnt seem to have + // to do anything directly with QoS. if (ACE_OS::ioctl (dgram_mcast.get_handle (), // Socket. ACE_SIO_MULTIPOINT_LOOPBACK, // IO control code. &bFlag, // In buffer. @@ -308,8 +311,8 @@ main (int argc, char * argv[]) // that uses the I/O control code as SIO_SET_QOS. ACE_QoS ace_qos; - // Make sure the flowspec is set in the correct direction for - // the sender/client. + // Make sure the flowspec is set in the correct direction for the + // sender/client. ACE_Flow_Spec sending_flowspec; ACE_Flow_Spec receiving_flowspec; const iovec iov = {0, 0}; @@ -321,21 +324,21 @@ main (int argc, char * argv[]) ace_qos.receiving_flowspec (receiving_flowspec); ace_qos.provider_specific (iov); - // Set the QoS for the session. Replaces the ioctl () call that was being - // made previously. + // Set the QoS for the session. Replaces the ioctl () call that was + // being made previously. if (qos_session->qos (&dgram_mcast, - ace_qos) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to set QoS\n"), - -1); + ace_qos) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "Unable to set QoS\n"), + -1); else ACE_DEBUG ((LM_DEBUG, "Setting QOS succeeds.\n")); - // Instantiate a QOS Event Handler and pass the Dgram_Mcast and - // QoS session object into it. + // Instantiate a QOS Event Handler and pass the Dgram_Mcast and QoS + // session object into it. ACE_QOS_Event_Handler qos_event_handler (dgram_mcast, - qos_session); + qos_session); // Register the QOS Handler with the Reactor. if (ACE_Reactor::instance ()->register_handler |