From 918124fb0b2fdf05bf98aee2c74c85387f1d8638 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 4 Feb 2018 23:38:08 +0000 Subject: Listen for server replies on different ports on main and batch, and get servers to send replies to both (#1190). --- src/lib/encode_server.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/lib/encode_server.cc') diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index 7bef82b26..332c7ab46 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -277,9 +277,19 @@ EncodeServer::broadcast_received () if (_verbose) { cout << "Offering services to master " << _broadcast.send_endpoint.address().to_string () << "\n"; } - shared_ptr socket (new Socket); + + try { + shared_ptr socket (new Socket); + socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), MAIN_SERVER_PRESENCE_PORT)); + socket->write (xml.length() + 1); + socket->write ((uint8_t *) xml.c_str(), xml.length() + 1); + } catch (...) { + + } + try { - socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), SERVER_PRESENCE_PORT)); + shared_ptr socket (new Socket); + socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), BATCH_SERVER_PRESENCE_PORT)); socket->write (xml.length() + 1); socket->write ((uint8_t *) xml.c_str(), xml.length() + 1); } catch (...) { -- cgit v1.2.3