124 |
124 |
125 |
125 |
126 SessionHandler* create_basic_session_handler() { |
126 SessionHandler* create_basic_session_handler() { |
127 BasicSessionHandler *handler = malloc(sizeof(BasicSessionHandler)); |
127 BasicSessionHandler *handler = malloc(sizeof(BasicSessionHandler)); |
128 handler->threadpool = threadpool_new(4, 8); |
128 handler->threadpool = threadpool_new(4, 8); |
|
129 threadpool_start(handler->threadpool); // TODO: handle error |
129 handler->sh.enqueue_connection = basic_enq_conn; |
130 handler->sh.enqueue_connection = basic_enq_conn; |
130 handler->sh.keep_alive = basic_keep_alive; |
131 handler->sh.keep_alive = basic_keep_alive; |
131 handler->sh.create_iostream = create_connection_iostream; |
132 handler->sh.create_iostream = create_connection_iostream; |
132 |
133 |
133 return (SessionHandler*)handler; |
134 return (SessionHandler*)handler; |