spectran http source + hermes source cleanup

This commit is contained in:
AlexandreRouma
2022-12-04 02:10:34 +01:00
parent b104e82874
commit f163e926c7
14 changed files with 1837 additions and 23 deletions

View File

@@ -0,0 +1,25 @@
#pragma once
#include <dsp/stream.h>
#include <dsp/types.h>
#include <string>
#include <thread>
#include "proto/http.h"
class SpectranHTTPClient {
public:
SpectranHTTPClient(std::string host, int port, dsp::stream<dsp::complex_t>* stream);
void streaming(bool enabled);
bool isOpen();
void close();
private:
void worker();
std::shared_ptr<net::Socket> sock;
net::http::Client http;
dsp::stream<dsp::complex_t>* stream;
std::thread workerThread;
bool streamingEnabled = false;
};