Main Page   Class Hierarchy   Compound List   File List   Compound Members  

servercore.h

00001 #ifndef GGZ_AGS_SERVERCORE_H
00002 #define GGZ_AGS_SERVERCORE_H
00003 
00004 // GGZ Advanced Game Server namespace
00005 namespace AGS
00006 {
00007         // Thread argument structure
00008         struct servarg_t
00009         {
00010                 int type;
00011                 int mode;
00012                 int port;
00013                 char *socketfile;
00014         };
00015 
00016         // Thread2 argument structure
00017         struct servarg2_t
00018         {
00019                 int mode;
00020                 int fd;
00021         };
00022 
00024         class ServerCore
00025         {
00026                 public:
00028                         ServerCore();
00029 
00032                         enum SocketTypes
00033                         {
00034                                 LocalSocket,
00035                                 NetworkSocket
00036                         };
00037 
00039                         enum SocketModes
00040                         {
00041                                 TCPSocket,
00042                                 UDPSocket
00043                         };
00044 
00046                         void createLocalSocket(int mode, const char *socketfile);
00047 
00049                         void createNetworkSocket(int mode, int port);
00050 
00051                 protected:
00053                         virtual void handleConnection(int mode, int fd);
00054 
00055                 private:
00056                         int listenLocalSocket(int mode, const char *socketfile);
00057                         int listenNetworkSocket(int mode, int port);
00058                         static void *threadwrap(void *arg);
00059                         static void *threadwrap2(void *arg);
00060 
00061         };
00062 };
00063 
00064 #endif
00065 

Generated on Mon May 6 10:52:13 2002 for GGZ Advanced Game Server by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001