3 //=============================================================================
7 * This is the ACE_Blob class, which is the API for doing file
10 * @author Prashant Jain and Sumedh Mungee
12 //=============================================================================
18 #include "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/INET_Addr.h"
25 #include "ace/Svc_Handler.h"
26 #include "ace/SOCK_Connector.h"
27 #include "ace/Connector.h"
28 #include "ace/Message_Block.h"
29 #include "Blob_Handler.h"
34 * @brief Blob is intended to provide application API to
35 * classes that wish to do network i/o at a very
36 * high level of abstraction.
37 * = This class provides the ability to retrieve data from
38 * the network, of specified length and offset, and potentially
39 * use any protocol "under the hood" to do so. It currently
40 * uses HTTP. See Blob_Handler also.
48 /// initializes the class with the given filename, hostname and port.
49 /// it should be called with the filename, before any read/write calls
50 int open (const ACE_TCHAR
*filename
,
51 const ACE_TCHAR
*hostname
= ACE_DEFAULT_SERVER_HOST
,
56 * starts a connection, and reads a file from the server,
57 * of length and offset as specified, into Message_Block mb
58 * The message block should have capacity to hold length number
61 int read (ACE_Message_Block
*mb
, size_t length
, size_t offset
);
64 * starts a connection, and writes a file to the server,
65 * of length and offset as specified, from Message_Block mb
66 * thus the message block should contain atleast length + offset
69 int write (ACE_Message_Block
*mb
, size_t length
, size_t offset
);
72 /// Frees memory allocated for filename.
76 /// store the internet address of the server
77 ACE_INET_Addr inet_addr_
;
82 /// The connector endpoint to initiate the client connection
83 ACE_Connector
<ACE_Blob_Handler
, ACE_SOCK_CONNECTOR
> connector_
;
86 #endif /* ACE_BLOB_H */