Rudiments
/home/dmuse/src/rudiments/include/rudiments/listener.h
00001 // Copyright (c) 2002 David Muse
00002 // See the COPYING file for more information.
00003 
00004 #ifndef RUDIMENTS_LISTENER_H
00005 #define RUDIMENTS_LISTENER_H
00006 
00007 #include <rudiments/private/listenerincludes.h>
00008 
00009 #ifdef RUDIMENTS_NAMESPACE
00010 namespace rudiments {
00011 #endif
00012 
00013 typedef linkedlist<filedescriptor *>            listenerlist;
00014 typedef linkedlistnode<filedescriptor *>        listenerlistnode;
00015 
00016 class listenerprivate;
00017 
00020 class RUDIMENTS_DLLSPEC listener {
00021         public:
00023                 listener();
00024 
00026                 virtual ~listener();
00027 
00030                 void    addFileDescriptor(filedescriptor *fd);
00031 
00048                 int32_t waitForNonBlockingRead(long sec, long usec);
00049 
00067                 int32_t waitForNonBlockingWrite(long sec, long usec);
00068 
00074                 listenerlist    *getReadyList();
00075 
00077                 void    removeFileDescriptor(filedescriptor *fd);
00078                         
00080                 void    removeAllFileDescriptors();
00081 
00082 
00085                 void    retryInterruptedWaits();
00086 
00090                 void    dontRetryInterruptedWaits();
00091 
00092         #include <rudiments/private/listener.h>
00093 };
00094 
00095 #ifdef RUDIMENTS_NAMESPACE
00096 }
00097 #endif
00098 
00099 #endif