Belle II Software
release-08-01-10
|
Log Connection to send the log message as JSON to a UDP server. More...
#include <LogConnectionUDP.h>
Public Member Functions | |
LogConnectionUDP (const std::string &hostname, unsigned short port) | |
Create a new UDP log connection with the hostname (as name or IP) and the port to connect to. More... | |
~LogConnectionUDP () override | |
Close the socket on destruction. | |
bool | sendMessage (const LogMessage &message) final |
Send the log message as JSON to the UDP server. | |
bool | isConnected () final |
there is no way to check if a UDP connection is fine, so we just return True always | |
virtual void | finalizeOnAbort () |
Called just before the system exists after a fatal error. More... | |
Private Attributes | |
boost::asio::io_service | m_ioservice |
asio service for handling the requests | |
boost::asio::ip::udp::socket | m_socket |
the socket to the UDP server | |
boost::asio::ip::udp::endpoint | m_remoteEndpoint |
the remote endpoint we send to | |
Log Connection to send the log message as JSON to a UDP server.
Definition at line 21 of file LogConnectionUDP.h.
LogConnectionUDP | ( | const std::string & | hostname, |
unsigned short | port | ||
) |
Create a new UDP log connection with the hostname (as name or IP) and the port to connect to.
if the hostname can not be resolved, this will throw an exception so dereferencing the result is always safe
Definition at line 17 of file LogConnectionUDP.cc.
|
inlinevirtualinherited |
Called just before the system exists after a fatal error.
Can be used to flush the output or close the file
Reimplemented in LogConnectionTxtFile, LogConnectionJSON, LogConnectionFilter, and LogConnectionConsole.
Definition at line 48 of file LogConnectionBase.h.