From 8f01c9a51e32891b862489e4082d2c20aa1fc883 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 9 Jun 2015 00:21:45 +0200 Subject: Improve sender and sender_client 1) Add sockguard in sockutils.hh to help with closing sockets 2) Make sender fork in background 3) Make sender_client start a sender if needed (and sender_bin specified in config) --- src/sender_client.hh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/sender_client.hh') diff --git a/src/sender_client.hh b/src/sender_client.hh index 5d0bd35..54339cf 100644 --- a/src/sender_client.hh +++ b/src/sender_client.hh @@ -10,12 +10,24 @@ class Config; class SenderClient { public: + class Error { + public: + virtual ~Error() {} + + virtual void error(const std::string& message) = 0; + virtual void error(const std::string& message, int error) = 0; + + protected: + Error() {} + }; + virtual ~SenderClient() {} virtual void send(const std::string& channel, const std::string& message) = 0; - static std::unique_ptr create(const Config* config); + static std::unique_ptr create( + const Config* config, std::shared_ptr error = nullptr); protected: SenderClient() {} -- cgit v1.2.3-70-g09d2