summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-11-16 00:44:33 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-11-16 00:44:33 (GMT)
commit69d34f5598974dddeab14e0fe9169108362622ec (patch)
tree17fbdbfc28dd11bc8852b697a262d63b9c76df38 /src/uscxml/Interpreter.cpp
parentf33e8148fc6e214886a8b24fc9d743ee25da7d61 (diff)
downloaduscxml-69d34f5598974dddeab14e0fe9169108362622ec.zip
uscxml-69d34f5598974dddeab14e0fe9169108362622ec.tar.gz
uscxml-69d34f5598974dddeab14e0fe9169108362622ec.tar.bz2
WebSockets!
Diffstat (limited to 'src/uscxml/Interpreter.cpp')
-rw-r--r--src/uscxml/Interpreter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp
index d14fae4..1314986 100644
--- a/src/uscxml/Interpreter.cpp
+++ b/src/uscxml/Interpreter.cpp
@@ -102,6 +102,7 @@ void InterpreterOptions::printUsageAndExit(const char* progName) {
printf("\t-lN : Set loglevel to N\n");
printf("\t-tN : port for HTTP server\n");
printf("\t-sN : port for HTTPS server\n");
+ printf("\t-wN : port for WebSocket server\n");
printf("\n");
exit(1);
}
@@ -122,6 +123,7 @@ InterpreterOptions InterpreterOptions::fromCmdLine(int argc, char** argv) {
{"dot", no_argument, 0, 'd'},
{"port", required_argument, 0, 't'},
{"ssl-port", required_argument, 0, 's'},
+ {"ws-port", required_argument, 0, 'w'},
{"certificate", required_argument, 0, 'c'},
{"private-key", required_argument, 0, 0},
{"public-key", required_argument, 0, 0},
@@ -143,7 +145,7 @@ InterpreterOptions InterpreterOptions::fromCmdLine(int argc, char** argv) {
int optionInd = 0;
int option;
for (;;) {
- option = getopt_long_only(argc, argv, "+vdt:s:c:p:l:", longOptions, &optionInd);
+ option = getopt_long_only(argc, argv, "+vdt:s:w:c:p:l:", longOptions, &optionInd);
if (option == -1) {
if (optind == argc)
// we are done with parsing
@@ -192,6 +194,9 @@ InterpreterOptions InterpreterOptions::fromCmdLine(int argc, char** argv) {
case 's':
currOptions->httpsPort = strTo<unsigned short>(optarg);
break;
+ case 'w':
+ currOptions->wsPort = strTo<unsigned short>(optarg);
+ break;
case 'v':
currOptions->verbose = true;
break;
@@ -1957,7 +1962,12 @@ void InterpreterImpl::setupIOProcessors() {
if (iequals(ioProcIter->first, "http")) {
// this is somewhat ugly
- _httpServlet = static_cast<InterpreterServlet*>(_ioProcessors[ioProcIter->first]._impl.get());
+ _httpServlet = static_cast<InterpreterHTTPServlet*>(_ioProcessors[ioProcIter->first]._impl.get());
+ }
+
+ if (iequals(ioProcIter->first, "websocket")) {
+ // this is somewhat ugly
+ _wsServlet = static_cast<InterpreterWebSocketServlet*>(_ioProcessors[ioProcIter->first]._impl.get());
}
// register aliases