4 //=============================================================================
8 * This is the HTTP_Client class, which is the API for doing file
11 * @author Stoyan Paunov
13 //=============================================================================
16 #ifndef TAO_HTTP_CLIENT_H
17 #define TAO_HTTP_CLIENT_H
19 #include /**/ "tao/TAO_Export.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #include "tao/orbconf.h"
27 #if (TAO_HAS_HTTP_PARSER == 1)
29 #include "ace/INET_Addr.h"
30 #include "ace/Svc_Handler.h"
31 #include "ace/SOCK_Connector.h"
32 #include "ace/Connector.h"
33 #include "ace/Message_Block.h"
34 #include "tao/HTTP_Handler.h"
36 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
39 * @class TAO_HTTP_Client
41 * @brief HTTP_Client is intended to provide application API to
42 * classes that wish to do network i/o at a very
43 * high level of abstraction.
45 * This class provides the ability to retrieve data from
46 * the network, of specified length and offset, and potentially
47 * use any protocol "under the hood" to do so. It currently
48 * uses HTTP. See HTTP_Handler also.
50 class TAO_Export TAO_HTTP_Client
56 /// Initializes the class with the given filename, hostname and port.
57 /// it should be called with the filename, before any read/write calls
58 int open (const ACE_TCHAR
*filename
,
59 const ACE_TCHAR
*hostname
= ACE_DEFAULT_SERVER_HOST
,
62 /// Starts a connection, and reads a file from the server into
64 int read (ACE_Message_Block
*mb
);
66 /// Frees memory allocated for filename.
70 /// Store the internet address of the server
71 ACE_INET_Addr inet_addr_
;
76 /// The connector endpoint to initiate the client connection
77 ACE_Connector
<TAO_HTTP_Handler
, ACE_SOCK_CONNECTOR
> connector_
;
80 TAO_END_VERSIONED_NAMESPACE_DECL
82 #endif /* TAO_HAS_HTTP_PARSER == 1 */
84 #endif /* TAO_HTTP_CLIENT_H */