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

SockServ.hh

Go to the documentation of this file.
00001 /*
00002 
00003     Socket server class
00004     Copyright (C) 1999-2001 Jussi Laako
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated on Sun Oct 26 19:11:22 2003 for HASAS by doxygen 1.3.3