Joedb 9.4.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
joedb::Server_Connection Class Reference

#include <joedb/concurrency/Server_Connection.h>

Inheritance diagram for joedb::Server_Connection:
Inheritance graph
[legend]
Collaboration diagram for joedb::Server_Connection:
Collaboration graph
[legend]

Public Member Functions

 Server_Connection (Channel &channel, std::ostream *log=nullptr)
 
size_t pread (char *data, size_t size, int64_t offset) const
 
int64_t handshake (const Readonly_Journal &client_journal, Content_Check content_check) override
 Called during Client construction.
 
int64_t pull (Lock_Action lock_action, Data_Transfer data_transfer, Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0)) override
 Pull from the connection.
 
int64_t push (const Readonly_Journal &client_journal, int64_t from, int64_t until, Unlock_Action unlock_action) override
 Push new data to the connection.
 
void unlock () override
 Unlock the connection.
 
- Public Member Functions inherited from joedb::Server_Client
 Server_Client (Channel &channel, std::ostream *log=nullptr)
 
void set_keep_alive_interval (std::chrono::seconds duration)
 
int64_t get_session_id () const
 
Thread_Safe_Channelget_channel ()
 
void ping ()
 
 ~Server_Client ()
 
- Public Member Functions inherited from joedb::Connection
virtual ~Connection ()
 

Protected Member Functions

bool check_matching_content (const Readonly_Journal &client_journal, int64_t server_checkpoint)
 
- Protected Member Functions inherited from joedb::Server_Client
void download (Async_Writer &writer, Channel_Lock &lock, int64_t size) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from joedb::Connection
static void content_mismatch ()
 Called by handshake when the file and the connection do not match.
 
- Protected Attributes inherited from joedb::Server_Client
Thread_Safe_Channel channel
 
std::ostream * log
 
bool connected
 
Buffer< 13 > buffer
 
int64_t session_id
 
bool pullonly_server
 
int64_t server_checkpoint
 

Detailed Description

Definition at line 10 of file Server_Connection.h.

Constructor & Destructor Documentation

◆ Server_Connection()

joedb::Server_Connection::Server_Connection ( Channel channel,
std::ostream *  log = nullptr 
)
inline

Definition at line 20 of file Server_Connection.h.

Member Function Documentation

◆ check_matching_content()

bool joedb::Server_Connection::check_matching_content ( const Readonly_Journal client_journal,
int64_t  server_checkpoint 
)
protected

Definition at line 15 of file Server_Connection.cpp.

◆ handshake()

int64_t joedb::Server_Connection::handshake ( const Readonly_Journal client_journal,
Content_Check  content_check 
)
overridevirtual
Parameters
client_journalmay be used to check matching content
content_checkindicates how matching content is tested
Return values
connectioncheckpoint

Reimplemented from joedb::Connection.

Definition at line 74 of file Server_Connection.cpp.

◆ pread()

size_t joedb::Server_Connection::pread ( char *  data,
size_t  size,
int64_t  offset 
) const

Definition at line 47 of file Server_Connection.cpp.

◆ pull()

int64_t joedb::Server_Connection::pull ( Lock_Action  lock_action,
Data_Transfer  data_transfer,
Writable_Journal client_journal,
std::chrono::milliseconds  wait = std::chrono::milliseconds(0) 
)
overridevirtual
Parameters
lock_actionwhether the connection should be locked before pulling
data_transferwhether data should be transferred
client_journaljournal to pull into
waitduration during which the connection may wait for new data if the pull would otherwise be empty
Return values
servercheckpoint

Reimplemented from joedb::Connection.

Definition at line 89 of file Server_Connection.cpp.

◆ push()

int64_t joedb::Server_Connection::push ( const Readonly_Journal client_journal,
int64_t  from,
int64_t  until,
Unlock_Action  unlock_action 
)
overridevirtual
Return values
servercheckpoint

Reimplemented from joedb::Connection.

Definition at line 136 of file Server_Connection.cpp.

◆ unlock()

void joedb::Server_Connection::unlock ( )
overridevirtual

Reimplemented from joedb::Connection.

Definition at line 189 of file Server_Connection.cpp.


The documentation for this class was generated from the following files: