Print message that marian-server is listening on port X after it is accepting connections (#705)

* Print 'server is listening' after it is accepting connections; fix #701
* Minor code formatting
This commit is contained in:
Roman Grundkiewicz 2020-09-03 11:47:10 +01:00 committed by GitHub
parent 9336746f89
commit 452f9c79e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Internal optional parameter in n-best list generation that skips empty hypotheses.
### Fixed
- Print "server is listening on port" message after it is accepting connections
- Fix compilation without BLAS installed
- Providing a single value to vector-like options using the equals sign, e.g. --models=model.npz
- Fix quiet-translation in marian-server

View File

@ -37,9 +37,8 @@ int main(int argc, char **argv) {
// Send translation back
connection->send(sendStream, [](const SimpleWeb::error_code &ec) {
if(ec) {
if(ec)
LOG(error, "Error sending message: ({}) {}", ec.value(), ec.message());
}
});
};
@ -52,8 +51,9 @@ int main(int argc, char **argv) {
// Start server thread
std::thread serverThread([&server]() {
LOG(info, "Server is listening on port {}", server.config.port);
server.start();
server.start([](unsigned short port) {
LOG(info, "Server is listening on port {}", port);
});
});
serverThread.join();