Cosmetic changes to UDP message client interface

This commit is contained in:
Bill Somerville 2018-11-12 19:11:43 +00:00
parent 6fdad18201
commit 9ce1fe94a3
2 changed files with 5 additions and 4 deletions

View File

@ -378,13 +378,14 @@ void MessageClient::set_server_port (port_type server_port)
m_->server_port_ = server_port; m_->server_port_ = server_port;
} }
void MessageClient::send_raw_datagram (QByteArray const& message, QHostAddress const& dest_address qint64 MessageClient::send_raw_datagram (QByteArray const& message, QHostAddress const& dest_address
, port_type dest_port) , port_type dest_port)
{ {
if (dest_port && !dest_address.isNull ()) if (dest_port && !dest_address.isNull ())
{ {
m_->writeDatagram (message, dest_address, dest_port); return m_->writeDatagram (message, dest_address, dest_port);
} }
return 0;
} }
void MessageClient::add_blocked_destination (QHostAddress const& a) void MessageClient::add_blocked_destination (QHostAddress const& a)

View File

@ -70,10 +70,10 @@ public:
// of record marker // of record marker
Q_SLOT void logged_ADIF (QByteArray const& ADIF_record); Q_SLOT void logged_ADIF (QByteArray const& ADIF_record);
// this slot may be used to send arbitrary UDP datagrams to and // this may be used to send arbitrary UDP datagrams to and
// destination allowing the underlying socket to be used for general // destination allowing the underlying socket to be used for general
// UDP messaging if desired // UDP messaging if desired
Q_SLOT void send_raw_datagram (QByteArray const&, QHostAddress const& dest_address, port_type dest_port); qint64 send_raw_datagram (QByteArray const&, QHostAddress const& dest_address, port_type dest_port);
// disallowed message destination (does not block datagrams sent // disallowed message destination (does not block datagrams sent
// with send_raw_datagram() above) // with send_raw_datagram() above)