1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Checkpointing, not ready to build yet.

This commit is contained in:
Patrick LeBlanc
2019-01-21 16:41:04 -06:00
parent d53471fc75
commit d84dcb9ccc
6 changed files with 266 additions and 9 deletions

View File

@ -0,0 +1,42 @@
// copy licensing stuff here
#ifndef _SOCKETPOOL_H_
#define _SOCKETPOOL_H_
#include <boost/utility.hpp>
#include <boost/thread/mutex.hpp>
#include "bytestream.h"
namespace idbdatafile
{
class SocketPool : public boost::noncopyable
{
public:
SocketPool();
// the dtor will immediately close all sockets
virtual ~SocketPool();
// 0 = success, -1 = failure. Should this throw instead?
int send_recv(const ByteStream &to_send, ByteStream *to_recv);
private:
int getSocket();
void returnSocket();
std::vector<int> allSockets;
std::deque<int> freeSockets;
boost::mutex mutex;
boost::condition socketAvailable;
int clientSocket;
int maxSockets;
static const int defaultSockets = 20;
};
}
#endif