summaryrefslogtreecommitdiffstats
path: root/src/shared/HTTPSender.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/HTTPSender.hpp')
-rw-r--r--src/shared/HTTPSender.hpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/shared/HTTPSender.hpp b/src/shared/HTTPSender.hpp
index 1025c071..1077b76d 100644
--- a/src/shared/HTTPSender.hpp
+++ b/src/shared/HTTPSender.hpp
@@ -20,14 +20,15 @@
#include <stdint.h>
#include <string>
-#include <libsoup/soup.h>
+#include <glibmm/thread.h>
+#include "raul/Thread.hpp"
namespace Ingen {
namespace Shared {
-class HTTPSender {
+class HTTPSender : public Raul::Thread {
public:
- HTTPSender(SoupServer* server, SoupMessage* msg);
+ HTTPSender();
virtual ~HTTPSender();
// Message bundling
@@ -38,13 +39,21 @@ public:
void transfer_begin() { bundle_begin(); }
void transfer_end() { bundle_end(); }
+ int listen_port() const { return _listen_port; }
+
protected:
- void send_chunk(const std::string& buf);
+ void _run();
+ void send_chunk(const std::string& buf);
+
enum SendState { Immediate, SendingBundle };
- SoupServer* _server;
- SoupMessage* _msg;
+ Glib::Mutex _mutex;
+ Glib::Cond _signal;
+
+ int _listen_port;
+ int _listen_sock;
+ int _client_sock;
SendState _send_state;
std::string _transfer;
};