bded48a306
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@986 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
32 lines
668 B
C++
32 lines
668 B
C++
/*
|
|
* simpleServer.h
|
|
*
|
|
* Created on: Aug 11, 2010
|
|
* Author: sears
|
|
*/
|
|
|
|
#ifndef SIMPLESERVER_H_
|
|
#define SIMPLESERVER_H_
|
|
#include "logstore.h"
|
|
|
|
class simpleServer {
|
|
public:
|
|
void* worker(int /*handle*/);
|
|
static const int DEFAULT_PORT = 32432;
|
|
static const int DEFAULT_THREADS = 1000;
|
|
|
|
simpleServer(logtable<datatuple> * ltable, int max_threads = DEFAULT_THREADS, int port = DEFAULT_PORT);
|
|
bool acceptLoop();
|
|
~simpleServer();
|
|
private:
|
|
logtable<datatuple>* ltable;
|
|
int port;
|
|
int max_threads;
|
|
int * thread_fd;
|
|
pthread_cond_t * thread_cond;
|
|
pthread_mutex_t * thread_mut;
|
|
pthread_t * thread;
|
|
bool running;
|
|
};
|
|
|
|
#endif /* SIMPLESERVER_H_ */
|