projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ab97d9d
)
Nicer exception when we fail to listen for remote encode servers because some other...
author
Carl Hetherington
<cth@carlh.net>
Tue, 21 Oct 2014 18:59:16 +0000
(19:59 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 21 Oct 2014 18:59:16 +0000
(19:59 +0100)
src/lib/server_finder.cc
patch
|
blob
|
history
diff --git
a/src/lib/server_finder.cc
b/src/lib/server_finder.cc
index 6371035910f6baba9e253790f356e164362f642a..35ce9e1a16e8686b51cae35f34783a6ef459946a 100644
(file)
--- a/
src/lib/server_finder.cc
+++ b/
src/lib/server_finder.cc
@@
-26,6
+26,8
@@
#include "cross.h"
#include "ui_signaller.h"
#include "cross.h"
#include "ui_signaller.h"
+#include "i18n.h"
+
using std::string;
using std::list;
using std::vector;
using std::string;
using std::list;
using std::vector;
@@
-105,11
+107,16
@@
try
using namespace boost::asio::ip;
boost::asio::io_service io_service;
using namespace boost::asio::ip;
boost::asio::io_service io_service;
- tcp::acceptor acceptor (io_service, tcp::endpoint (tcp::v4(), Config::instance()->server_port_base() + 1));
+ boost::scoped_ptr<tcp::acceptor> acceptor;
+ try {
+ acceptor.reset (new tcp::acceptor (io_service, tcp::endpoint (tcp::v4(), Config::instance()->server_port_base() + 1)));
+ } catch (...) {
+ boost::throw_exception (NetworkError (_("Could not listen for remote encode servers. Perhaps another instance of DCP-o-matic is running.")));
+ }
while (true) {
tcp::socket socket (io_service);
while (true) {
tcp::socket socket (io_service);
- acceptor
.
accept (socket);
+ acceptor
->
accept (socket);
/* XXX: these reads should have timeouts, otherwise we will stop finding servers
if one dies during this conversation
/* XXX: these reads should have timeouts, otherwise we will stop finding servers
if one dies during this conversation