3 //=============================================================================
7 * Ftp client to send data
9 * @author Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
11 //=============================================================================
17 #include "ace/Get_Opt.h"
18 #include "orbsvcs/Naming/Naming_Client.h"
19 #include "orbsvcs/AV/AVStreams_i.h"
20 #include "orbsvcs/AV/Endpoint_Strategy.h"
21 #include "orbsvcs/AV/Policy.h"
22 #include "orbsvcs/AV/Protocol_Factory.h"
26 * @class FTP_Client_Callback
28 * @brief Defines the client applcation callback.
30 * This class can override the methods of
31 * the TAO_AV_Callback to do application
32 * specific processing.
34 class FTP_Client_Callback
: public TAO_AV_Callback
38 FTP_Client_Callback ();
43 * @class FTP_Client_StreamEndPoint
45 * @brief Defines the client stream endpoint.
47 * This class overrides the methods of TAO_ClientStreamendpoint
48 * so the application can perform its processing during post and pre
51 class FTP_Client_StreamEndPoint
: public TAO_Client_StreamEndPoint
55 FTP_Client_StreamEndPoint ();
57 /// Create the application client callback and return its handle to the
58 /// AVStreams for further application callbacks
59 virtual int get_callback (const char *flowname
,
60 TAO_AV_Callback
*&callback
);
62 /// Set protocol object corresponding to the transport protocol chosen.
63 virtual int set_protocol_object (const char *flowname
,
64 TAO_AV_Protocol_Object
*object
);
67 /// reference to the cllient application callback.
68 FTP_Client_Callback callback_
;
71 typedef TAO_AV_Endpoint_Reactive_Strategy_A
<FTP_Client_StreamEndPoint
,TAO_VDev
,AV_Null_MediaCtrl
> ENDPOINT_STRATEGY
;
77 * @brief Defines the Client Application
79 * The actual client program that acts as the ftp client that streams data
80 * to the ftp servers that are waiting for data.
88 /// Method to initialize the various data components.
92 /// Set the protocol object corresponding to the transport protocol chosen.
93 void set_protocol_object (TAO_AV_Protocol_Object
*protocol_object
);
95 /// Method to pace and send data from a file.
98 /// File handle from which data is read to be sent.
101 /// The stream control interface that manages the stream set up
102 TAO_StreamCtrl
* streamctrl ();
104 /// name of the flow set up.
107 /// The requested frame rate for sending each frame of data read from the file.
111 /// Method to parse the command line arguments.
112 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
114 /// Method that binds the ftp client to the server
115 int bind_to_server ();
117 /// The reacfive strategy of the client.
118 ENDPOINT_STRATEGY endpoint_strategy_
;
120 /// The server MMDevice that the ftpo client connects to
121 AVStreams::MMDevice_var server_mmdevice_
;
123 /// The ftp client MMDevice.
124 TAO_MMDevice client_mmdevice_
;
126 /// Video stream controller
127 TAO_StreamCtrl streamctrl_
;
129 /// Number of frames sent.
135 /// File from which data is read.
136 const char *filename_
;
138 /// Address of the ftp client host machine or a multicast address - Default is
139 /// UDP multicast addess
140 const char *address_
;
141 const char *peer_addr_str_
;
143 /// The Naming Service client.
144 TAO_Naming_Client my_naming_client_
;
146 /// File handle of the file read from.
149 /// Selected protocol - default is UDP
154 /// If set to 1 then use sfp as the flow carrier protocol.
159 /// Message block into which data is read from a file and then sent.
160 ACE_Message_Block mb
;
162 /// Protocol object corresponding to the transport protocol selected.
163 TAO_AV_Protocol_Object
* protocol_object_
;
166 typedef ACE_Unmanaged_Singleton
<Client
,ACE_Null_Mutex
> CLIENT
;
168 #endif /* TAO_AV_FTP_H */