diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-02-04 23:38:08 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-02-04 23:38:08 +0000 |
| commit | 918124fb0b2fdf05bf98aee2c74c85387f1d8638 (patch) | |
| tree | 209154022d91c7381c2ed1b2b00f01ebe14997e6 /src/lib/encode_server.cc | |
| parent | 9a5f1ef94b9916f5cd5996255007200bf61af7bf (diff) | |
Listen for server replies on different ports on main and batch, and get servers to send replies to both (#1190).
Diffstat (limited to 'src/lib/encode_server.cc')
| -rw-r--r-- | src/lib/encode_server.cc | 14 |
1 files changed, 12 insertions, 2 deletions
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> socket (new Socket); + + try { + shared_ptr<Socket> 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> 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 (...) { |
