summaryrefslogtreecommitdiff
path: root/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-04-13 14:47:50 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-04-13 14:47:50 +0000
commitfeb8e89d1f3932917e3068c9c23db15ce55286e4 (patch)
tree0d62c61c2e4151b7665392d162436ee7d1e6782d /TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp
parentcbe8aa5d5be1d4679ae0c4e30baaea24fbae416c (diff)
downloadATCD-feb8e89d1f3932917e3068c9c23db15ce55286e4.tar.gz
Thu Apr 13 13:43:19 UTC 2006 William R. Otte <wotte@dre.vanderbilt.edu>escher_x_4_9_integration_point
Diffstat (limited to 'TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp')
-rw-r--r--TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp
new file mode 100644
index 00000000000..73a8071f305
--- /dev/null
+++ b/TAO/CIAO/DAnCE/NodeApplicationManager/HTTP_Client.cpp
@@ -0,0 +1,59 @@
+// $Id$
+
+// HTTP_Client.cpp, Stoyan
+
+#include "HTTP_Client.h"
+#include "HTTP_Handler.h"
+#include "ace/OS_NS_string.h"
+
+HTTP_Client::HTTP_Client (void)
+{
+}
+
+HTTP_Client::~HTTP_Client (void)
+{
+ this->close ();
+}
+
+// initialize address and filename. No network i/o in open
+int
+HTTP_Client::open (const ACE_TCHAR *filename,
+ const ACE_TCHAR *hostname,
+ u_short port)
+{
+ filename_ = ACE_OS::strdup (filename);
+ inet_addr_.set (port, hostname);
+ return 0;
+}
+
+// read from connection length bytes from offset, into Message block
+int
+HTTP_Client::read (ACE_Message_Block *mb)
+{
+
+ // Create a HTTP_Client Reader
+ HTTP_Reader HTTP_reader (mb, filename_);
+ HTTP_Handler *brp = &HTTP_reader;
+
+ // Connect to the server
+ if (connector_.connect (brp, inet_addr_) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "HTTP_Client::read():Connector error"), -1);
+
+ return HTTP_reader.byte_count ();
+
+}
+
+// close down the HTTP_Client
+int
+HTTP_Client::close (void)
+{
+
+ if (filename_)
+ {
+ ACE_OS::free ((void *) filename_);
+ filename_ = 0;
+ }
+ return 0;
+
+}
+