Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Server_Client.h
Go to the documentation of this file.
1#ifndef joedb_Server_Client_declared
2#define joedb_Server_Client_declared
3
7
8#include <condition_variable>
9#include <thread>
10#include <iosfwd>
11#include <chrono>
12
13namespace joedb
14{
15 /// @ingroup concurrency
17 {
18 friend class Server_File;
19
20 private:
21 std::chrono::seconds keep_alive_interval;
22 std::condition_variable condition;
23 void ping(Channel_Lock &lock);
24 bool keep_alive_thread_must_stop;
25 std::thread keep_alive_thread;
26 void keep_alive();
27 void connect();
28 void disconnect();
29
30 protected:
32 std::ostream *log;
34
36
37 int64_t session_id;
40
41 void download(Async_Writer &writer, Channel_Lock &lock, int64_t size) const;
42
43 public:
45
46 void set_log(std::ostream *stream)
47 {
48 log = stream;
49 }
50
51 void set_keep_alive_interval(std::chrono::seconds duration)
52 {
53 keep_alive_interval = duration;
54 }
55
56 int64_t get_session_id() const {return session_id;}
58 void ping();
59
61 };
62}
63
64#endif
void set_keep_alive_interval(std::chrono::seconds duration)
void download(Async_Writer &writer, Channel_Lock &lock, int64_t size) const
void set_log(std::ostream *stream)
int64_t get_session_id() const
Thread_Safe_Channel & get_channel()
Thread_Safe_Channel channel
std::ostream * log
Directly read file served from joedb_server.
Definition Server_File.h:23
Definition Blob.h:7