27 #include <relpipe/reader/RelpipeReaderException.h> |
27 #include <relpipe/reader/RelpipeReaderException.h> |
28 |
28 |
29 #include <relpipe/writer/RelationalWriter.h> |
29 #include <relpipe/writer/RelationalWriter.h> |
30 #include <relpipe/writer/RelpipeWriterException.h> |
30 #include <relpipe/writer/RelpipeWriterException.h> |
31 #include <relpipe/writer/Factory.h> |
31 #include <relpipe/writer/Factory.h> |
|
32 #include <unistd.h> |
32 |
33 |
33 #include "HTTPDHandler.h" |
34 #include "HTTPDHandler.h" |
34 #include "CLIParser.h" |
35 #include "CLIParser.h" |
35 #include "Configuration.h" |
36 #include "Configuration.h" |
36 |
37 |
55 serverOptions.tcpPort = configuration.tcpPort; |
56 serverOptions.tcpPort = configuration.tcpPort; |
56 std::shared_ptr<HTTPServer> httpServer(HTTPServer::create(serverOptions)); |
57 std::shared_ptr<HTTPServer> httpServer(HTTPServer::create(serverOptions)); |
57 HttpdHandler handler(writer, configuration, httpServer); |
58 HttpdHandler handler(writer, configuration, httpServer); |
58 reader->addHandler(&handler); |
59 reader->addHandler(&handler); |
59 reader->process(); |
60 reader->process(); |
60 |
|
61 resultCode = CLI::EXIT_CODE_SUCCESS; |
61 resultCode = CLI::EXIT_CODE_SUCCESS; |
62 |
|
63 } catch (RelpipeCLIException& e) { |
62 } catch (RelpipeCLIException& e) { |
64 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str()); |
63 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str()); |
65 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
64 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
66 resultCode = e.getExitCode(); |
65 resultCode = e.getExitCode(); |
67 } catch (RelpipeReaderException& e) { |
66 } catch (RelpipeReaderException& e) { |