Back to index

lightning-sunbird  0.9+nobinonly
GUSIMTUdp.h
Go to the documentation of this file.
00001 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00002 // % Project  :      GUSI                        -      Grand Unified Socket Interface                    
00003 // % File            :      GUSIMTUdp.nw         -      UDP code for MacTCP                           
00004 // % Author   :      Matthias Neeracher                                           
00005 // % Language :      C++                                                        
00006 // %                                                                       
00007 // % $Log: GUSIMTUdp.h,v $
00008 // % Revision 1.1  2001/03/11 22:36:08  sgehani%netscape.com
00009 // % First Checked In.
00010 // %                                                
00011 // % Revision 1.11  2000/10/16 04:02:00  neeri                             
00012 // % Save A5 in completion routines                                        
00013 // %                                                                       
00014 // % Revision 1.10  2000/05/23 07:05:16  neeri                             
00015 // % Improve formatting                                                    
00016 // %                                                                       
00017 // % Revision 1.9  2000/03/06 06:10:01  neeri                              
00018 // % Reorganize Yield()                                                    
00019 // %                                                                       
00020 // % Revision 1.8  1999/08/26 05:45:04  neeri                              
00021 // % Fixes for literate edition of source code                             
00022 // %                                                                       
00023 // % Revision 1.7  1999/08/02 07:02:44  neeri                              
00024 // % Support for asynchronous errors and other socket options              
00025 // %                                                                       
00026 // % Revision 1.6  1999/07/20 04:25:53  neeri                              
00027 // % Fixed race condition in sendto()                                      
00028 // %                                                                       
00029 // % Revision 1.5  1999/06/28 06:04:59  neeri                              
00030 // % Support interrupted calls                                             
00031 // %                                                                       
00032 // % Revision 1.4  1999/05/29 06:26:44  neeri                              
00033 // % Fixed header guards                                                   
00034 // %                                                                       
00035 // % Revision 1.3  1999/03/17 09:05:09  neeri                              
00036 // % Added GUSITimer, expanded docs                                        
00037 // %                                                                       
00038 // % Revision 1.2  1998/11/22 23:06:57  neeri                              
00039 // % Releasing 2.0a4 in a hurry                                            
00040 // %                                                                       
00041 // % Revision 1.1  1998/10/25 11:57:37  neeri                              
00042 // % Ready to release 2.0a3                                                
00043 // %                                                                       
00044 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00045 //                                                                         
00046 // \chapter{MacTCP UDP sockets}                                            
00047 //                                                                         
00048 // A [[GUSIMTUdpSocket]] implements the UDP socket class for MacTCP. All instances
00049 // of [[GUSIMTUdpSocket]] are created by the [[GUSIMTUdpFactory]] singleton, so
00050 // there is no point in exporting the class itself.                        
00051 //                                                                         
00052 // <GUSIMTUdp.h>=                                                          
00053 #ifndef _GUSIMTUdp_
00054 #define _GUSIMTUdp_
00055 
00056 #ifdef GUSI_SOURCE
00057 
00058 #include <sys/cdefs.h>
00059 
00060 __BEGIN_DECLS
00061 // \section{Definition of [[GUSIMTUdpFactory]]}                            
00062 //                                                                         
00063 // [[GUSIMTUdpFactory]] is a singleton subclass of [[GUSISocketFactory]].  
00064 //                                                                         
00065 // <Definition of [[GUSIwithMTUdpSockets]]>=                               
00066 void GUSIwithMTUdpSockets();
00067 __END_DECLS
00068 
00069 #ifdef GUSI_INTERNAL
00070 
00071 #include "GUSIFactory.h"
00072 
00073 // <Definition of class [[GUSIMTUdpFactory]]>=                             
00074 class GUSIMTUdpFactory : public GUSISocketFactory {
00075 public:
00076        static GUSISocketFactory *  Instance();
00077        virtual GUSISocket *               socket(int domain, int type, int protocol);
00078 private:
00079        GUSIMTUdpFactory()                        {}
00080        static GUSISocketFactory *  instance;
00081 };
00082 
00083 // <Inline member functions for class [[GUSIMTUdpFactory]]>=               
00084 inline GUSISocketFactory * GUSIMTUdpFactory::Instance()
00085 {
00086        if (!instance)
00087               instance = new GUSIMTUdpFactory;
00088        return instance;
00089 }
00090 
00091 #endif /* GUSI_INTERNAL */
00092 
00093 #endif /* GUSI_SOURCE */
00094 
00095 #endif /* _GUSIMTUdp_ */