summaryrefslogtreecommitdiff
path: root/orkaudio/MultiThreadedServer.h
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2005-10-20 13:40:58 +0000
committerHenri Herscher <henri@oreka.org>2005-10-20 13:40:58 +0000
commit7e1d63dd9fd149e4934bf77095c8610fac786b04 (patch)
tree5fe486a1b0300c3b84fb559107a868e5cc2c95da /orkaudio/MultiThreadedServer.h
parent467768fc956fc3e5a253373f26c71c681b31b6b8 (diff)
First checkin
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@2 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/MultiThreadedServer.h')
-rw-r--r--orkaudio/MultiThreadedServer.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/orkaudio/MultiThreadedServer.h b/orkaudio/MultiThreadedServer.h
new file mode 100644
index 0000000..19c58bc
--- /dev/null
+++ b/orkaudio/MultiThreadedServer.h
@@ -0,0 +1,53 @@
+/*
+ * Oreka -- A media capture and retrieval platform
+ *
+ * Copyright (C) 2005, orecx LLC
+ *
+ * http://www.orecx.com
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License.
+ * Please refer to http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#ifndef __MULTITHREADEDSERVER_H__
+#define __MULTITHREADEDSERVER_H__
+
+#include "ace/Acceptor.h"
+#include "ace/SOCK_Acceptor.h"
+
+/** This server accepts permanent telnet like connections.
+ commands are accepted in "single line" format.
+ one thread per connection
+*/
+class CommandLineServer : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+{
+public:
+ virtual int open (void *);
+ /** daemon thread */
+ static void run(void *args);
+ /** service routine */
+ virtual int svc (void);
+};
+typedef ACE_Acceptor<CommandLineServer, ACE_SOCK_ACCEPTOR> CommandLineAcceptor;
+
+
+/** This server is a lightweight http server that extracts commands from URLs and outputs results in xml format
+ one thread per connection
+ Example url:
+ http://localhost:23000/message=print&text=hello
+*/
+class HttpServer : public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
+{
+public:
+ virtual int open (void *);
+ /** daemon thread */
+ static void run(void *args);
+ /** service routine */
+ virtual int svc (void);
+};
+typedef ACE_Acceptor<HttpServer, ACE_SOCK_ACCEPTOR> HttpAcceptor;
+
+#endif
+