00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <sys/socket.h>
00024 #include <sys/un.h>
00025
00026
00027 #ifndef SOCKSERV_HH
00028 #define SOCKSERV_HH
00029
00030 #ifndef UNIX_PATH_MAX
00031 #define UNIX_PATH_MAX 108
00032 #endif
00033
00034 #define SOCKSERV_LISTENQUEUE_LEN 8
00035
00036 #if (defined(__QNX__) && !defined(socklen_t))
00037 typedef size_t socklen_t;
00038 #endif
00039
00040
00044 class clSockServ
00045 {
00046 int iErrno;
00047 int iListenH;
00048 bool bLocal;
00049 char cpLocalSockName[UNIX_PATH_MAX + 1];
00050 public:
00051 clSockServ ();
00052 clSockServ (unsigned short);
00053 clSockServ (const char *);
00054 ~clSockServ ();
00061 bool Bind (unsigned short);
00069 bool Bind (const char *, unsigned short);
00076 bool Bind (const char *);
00084 int WaitForConnect ();
00093 int WaitForConnect (int);
00097 void Close ();
00103 int GetErrno () { return iErrno; }
00104 };
00105
00106 #endif