From 9cd3ccffd5372dfde3af478e3f832f18db4be3f1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:41 +0200 Subject: tagging tags --- ychat-0.2/sock.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 ychat-0.2/sock.h (limited to 'ychat-0.2/sock.h') diff --git a/ychat-0.2/sock.h b/ychat-0.2/sock.h new file mode 100755 index 0000000..abb5878 --- /dev/null +++ b/ychat-0.2/sock.h @@ -0,0 +1,51 @@ +// class sock declaration. + +#ifndef SOCK_H +#define SOCK_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "incl.h" +#include "pool.h" +#include "reqp.h" +#include "thrd.h" + +using namespace std; + +class sock +{ +private: + // total number of server requests. + unsigned long long int i_req; + + bool b_run; // true while socket manager is running. + reqp* req_parser; // parses the http requests from clients. + pool* thrd_pool; // the thread pool. + + // the chat stream there all the chat messages will sent through. + static void chat_stream( int i_sock, map_string &map_params ); + + // creates a server socket. + virtual int make_socket( uint16_t port ); + +public: + // small inline methods: + bool get_run() const { return b_run; } + bool set_run( bool b_run ) { this->b_run = b_run; } + + // public methods. + explicit sock( ); // simple constructor. + virtual int read_write( thrd* p_thrd, int filedes ); + virtual int start(); +}; + +#endif -- cgit v1.2.3