Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

InetUserServer.h

00001 /*
00002    Copyright (C) 2002 - 2003 the Strongroom project
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    @author Denis de Leeuw Duarte
00010    @author Ewald Snel
00011 */
00012 
00013 #ifndef __INETUSERSERVER_H_
00014 #define __INETUSERSERVER_H_
00015 
00016 #include <list>
00017 
00018 #include <ServerSocket.h>
00019 #include <Socket.h>
00020 #include <UserPlugin.h>
00021 #include <semaphore.h>
00022 
00023 
00024 #include "InetUserConnection.h"
00025 
00026 
00064 class InetUserServer : public UserPlugin
00065 {
00066   friend void *serverThreadEntry( void *usermodule );
00067 
00068 public:
00069     InetUserServer( const Config &cfg );
00070     ~InetUserServer();
00071 
00072     bool init();
00073 
00074     CoreError run();
00075     void shutdown();
00076 
00077 private:
00078     void serverThread();
00079 
00080     pthread_t serverThreadHandle;
00081     sem_t shutd;
00082     bool running;
00083     ServerSocket *serverSocket;
00084     list<InetUserConnection *> connections;
00085 };
00086 
00087 /*
00088  * Entrypoint to the user server's main thread.  
00089  */
00090 void *serverThreadEntry( void *usermodule );
00091 
00092 #endif /*__INETUSERSERVER_H_*/

Generated on Wed Feb 18 13:45:55 2004 for strongroom by doxygen1.2.18