From 23c5e7d57e1e9216f4da3446656df2dc7202975d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 6 Apr 2013 13:14:45 +0200 Subject: tagging ychat-0.1 --- sock.h | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) mode change 100755 => 100644 sock.h (limited to 'sock.h') diff --git a/sock.h b/sock.h old mode 100755 new mode 100644 index d477987..9893007 --- a/sock.h +++ b/sock.h @@ -1,7 +1,7 @@ // class sock declaration. -#ifndef s_sock_H -#define s_sock_H +#ifndef SOCK_H +#define SOCK_H #include #include @@ -15,10 +15,8 @@ #include #include "incl.h" -#include "pool.h" #include "reqp.h" #include "thrd.h" -#include "user.h" using namespace std; @@ -27,14 +25,24 @@ class sock private: // total number of server requests. unsigned long long int i_req; + queue thrd_pool; + + int i_thrd_pool_size; bool b_run; // true while socket manager is running. reqp* req_parser; // parses the http requests from clients. - pool* thrd_pool; // the thread pool. - // creates a server socket. + // the chat stream there all the chat messages will sent through. +#ifdef THRDMOD + static void chat_stream( int i_sock, map_string &map_params ); +#else + static void chat_stream( int i_sock, map_string &map_params, queue &thrd_pool ); +#endif virtual int make_socket( uint16_t port ); + static void *posix_thread_func ( void *v_pointer ); + static void *posix_thread_func_( void *v_pointer ); + public: // small inline methods: bool get_run() const { return b_run; } @@ -42,12 +50,10 @@ public: // public methods. explicit sock( ); // simple constructor. - virtual int read_write( thrd* p_thrd, int filedes ); + virtual int read_write( int filedes ); virtual int start(); - // the chat stream there all the chat messages will sent through. - static void chat_stream( int i_sock, user* p_user, map_string &map_params ); - + virtual void refill_thrd_pool( ); // refills the thread pool with new thewads. }; #endif -- cgit v1.2.3