summaryrefslogtreecommitdiff
path: root/src/sender_client.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2015-06-09 00:21:45 +0200
committerJoel Klinghed <the_jk@yahoo.com>2015-06-09 00:21:45 +0200
commit8f01c9a51e32891b862489e4082d2c20aa1fc883 (patch)
treec8f21cb9768c0853da6f68decae316c1f9c7a2f5 /src/sender_client.hh
parent913cfd1c7ef7a145036a8416d4ea815cb5cdb601 (diff)
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)
Diffstat (limited to 'src/sender_client.hh')
-rw-r--r--src/sender_client.hh14
1 files changed, 13 insertions, 1 deletions
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<SenderClient> create(const Config* config);
+ static std::unique_ptr<SenderClient> create(
+ const Config* config, std::shared_ptr<Error> error = nullptr);
protected:
SenderClient() {}