From 59602b67d0637817a156b7bd0fc05f96fe41dee5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 6 Nov 2013 16:43:01 +0000 Subject: Various bits of server tidying up. --- src/tools/dcpomatic_server_cli.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/dcpomatic_server_cli.cc b/src/tools/dcpomatic_server_cli.cc index e9540ff70..1ec985b4b 100644 --- a/src/tools/dcpomatic_server_cli.cc +++ b/src/tools/dcpomatic_server_cli.cc @@ -98,6 +98,14 @@ main (int argc, char* argv[]) Scaler::setup_scalers (); shared_ptr log (new FileLog ("dcpomatic_server_cli.log")); Server server (log, verbose); - server.run (num_threads); + try { + server.run (num_threads); + } catch (boost::system::system_error e) { + if (e.code() == boost::system::errc::address_in_use) { + cerr << argv[0] << ": address already in use. Is another DCP-o-matic server instance already running?\n"; + exit (EXIT_FAILURE); + } + cerr << argv[0] << ": " << e.what() << "\n"; + } return 0; } -- cgit v1.2.3