Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / AVStreams / Latency / ping.h
blobb5623956b539225ebceccdf617283c6d4a5fbf7c
2 //=============================================================================
3 /**
4 * @file ping.h
6 * @author Carlos O'Ryan
7 */
8 //=============================================================================
11 #ifndef TAO_PING_H
12 #define TAO_PING_H
14 #include "orbsvcs/AV/AVStreams_i.h"
15 #include "orbsvcs/AV/Policy.h"
16 #include "orbsvcs/AV/Flows_T.h"
17 #include "ace/OS_NS_time.h"
19 class Ping_Recv_Callback : public TAO_AV_Callback
21 public:
22 Ping_Recv_Callback (void);
23 virtual int handle_stop (void);
24 virtual int receive_frame (ACE_Message_Block *frame,
25 TAO_AV_frame_info *frame_info = 0,
26 const ACE_Addr &peer_address = ACE_Addr::sap_any);
27 virtual int handle_destroy (void);
28 protected:
29 int count_;
32 class Ping_Recv : public TAO_FlowConsumer
34 public:
35 Ping_Recv (void);
37 virtual int get_callback (const char *flowname,
38 TAO_AV_Callback *&callback);
40 private:
41 /// The callback object...
42 Ping_Recv_Callback callback_;
45 class Pong_Send_Callback : public TAO_AV_Callback
47 public:
49 /// Ad-hoc method to send a response outside the context of a
50 /// handle_timeout.
51 int send_response (ACE_hrtime_t stamp);
53 virtual int handle_timeout (void *arg);
54 virtual int handle_end_stream (void);
55 virtual void get_timeout (ACE_Time_Value *&tv,
56 void *&arg);
59 class Pong_Send : public TAO_FlowProducer
61 public:
62 Pong_Send (void);
63 virtual int get_callback (const char *flowname,
64 TAO_AV_Callback *&callback);
67 typedef TAO_AV_Endpoint_Reactive_Strategy_B <TAO_StreamEndPoint_B,TAO_VDev,AV_Null_MediaCtrl> Reactive_Strategy;
69 typedef TAO_FDev<TAO_FlowProducer,Ping_Recv> Ping_Recv_FDev;
70 typedef TAO_FDev<Pong_Send,TAO_FlowConsumer> Pong_Send_FDev;
72 #endif /* TAO_PING_H */