Back to index

lightning-sunbird  0.9+nobinonly
GUSIMTTcp.h
Go to the documentation of this file.
00001 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00002 // % Project  :      GUSI                        -      Grand Unified Socket Interface                    
00003 // % File            :      GUSIMTTcp.nw         -      TCP code for MacTCP                           
00004 // % Author   :      Matthias Neeracher                                           
00005 // % Language :      C++                                                        
00006 // %                                                                       
00007 // % $Log: GUSIMTTcp.h,v $
00008 // % Revision 1.1  2001/03/11 22:36:04  sgehani%netscape.com
00009 // % First Checked In.
00010 // %                                                
00011 // % Revision 1.17  2000/10/16 04:01:59  neeri                             
00012 // % Save A5 in completion routines                                        
00013 // %                                                                       
00014 // % Revision 1.16  2000/05/23 07:04:20  neeri                             
00015 // % Improve formatting, fix hang on close                                 
00016 // %                                                                       
00017 // % Revision 1.15  2000/03/06 06:10:02  neeri                             
00018 // % Reorganize Yield()                                                    
00019 // %                                                                       
00020 // % Revision 1.14  1999/08/26 05:42:13  neeri                             
00021 // % Fix nonblocking connects                                              
00022 // %                                                                       
00023 // % Revision 1.13  1999/08/02 07:02:44  neeri                             
00024 // % Support for asynchronous errors and other socket options              
00025 // %                                                                       
00026 // % Revision 1.12  1999/06/28 06:04:58  neeri                             
00027 // % Support interrupted calls                                             
00028 // %                                                                       
00029 // % Revision 1.11  1999/06/08 04:31:29  neeri                             
00030 // % Getting ready for 2.0b2                                               
00031 // %                                                                       
00032 // % Revision 1.10  1999/05/30 03:09:30  neeri                             
00033 // % Added support for MPW compilers                                       
00034 // %                                                                       
00035 // % Revision 1.9  1999/03/17 09:05:08  neeri                              
00036 // % Added GUSITimer, expanded docs                                        
00037 // %                                                                       
00038 // % Revision 1.8  1998/11/22 23:06:55  neeri                              
00039 // % Releasing 2.0a4 in a hurry                                            
00040 // %                                                                       
00041 // % Revision 1.7  1998/10/25 11:31:42  neeri                              
00042 // % Add MSG_PEEK support, make releases more orderly.                     
00043 // %                                                                       
00044 // % Revision 1.6  1998/10/11 16:45:18  neeri                              
00045 // % Ready to release 2.0a2                                                
00046 // %                                                                       
00047 // % Revision 1.5  1998/08/01 21:32:07  neeri                              
00048 // % About ready for 2.0a1                                                 
00049 // %                                                                       
00050 // % Revision 1.4  1998/01/25 20:53:56  neeri                              
00051 // % Engine implemented, except for signals & scheduling                   
00052 // %                                                                       
00053 // % Revision 1.3  1997/11/13 21:12:11  neeri                              
00054 // % Fall 1997                                                             
00055 // %                                                                       
00056 // % Revision 1.2  1996/12/22 19:57:57  neeri                              
00057 // % TCP streams work                                                      
00058 // %                                                                       
00059 // % Revision 1.1  1996/12/16 02:12:41  neeri                              
00060 // % TCP Sockets sort of work                                              
00061 // %                                                                       
00062 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00063 //                                                                         
00064 // \chapter{MacTCP TCP sockets}                                            
00065 //                                                                         
00066 // A [[GUSIMTTcpSocket]] implements the TCP socket class for MacTCP. All instances
00067 // of [[GUSIMTTcpSocket]] are created by the [[GUSIMTTcpFactory]] singleton, so
00068 // there is no point in exporting the class itself.                        
00069 //                                                                         
00070 // <GUSIMTTcp.h>=                                                          
00071 #ifndef _GUSIMTTcp_
00072 #define _GUSIMTTcp_
00073 
00074 #ifdef GUSI_SOURCE
00075 
00076 #include <sys/cdefs.h>
00077 
00078 __BEGIN_DECLS
00079 // \section{Definition of [[GUSIMTTcpFactory]]}                            
00080 //                                                                         
00081 // [[GUSIMTTcpFactory]] is a singleton subclass of [[GUSISocketFactory]].  
00082 //                                                                         
00083 // <Definition of [[GUSIwithMTTcpSockets]]>=                               
00084 void GUSIwithMTTcpSockets();
00085 __END_DECLS
00086 
00087 #ifdef GUSI_INTERNAL
00088 
00089 #include "GUSIFactory.h"
00090 
00091 // <Definition of class [[GUSIMTTcpFactory]]>=                             
00092 class GUSIMTTcpFactory : public GUSISocketFactory {
00093 public:
00094        static GUSISocketFactory *  Instance();
00095        virtual GUSISocket *               socket(int domain, int type, int protocol);
00096 private:
00097        GUSIMTTcpFactory()                        {}
00098        static GUSISocketFactory *  instance;
00099 };
00100 
00101 // <Inline member functions for class [[GUSIMTTcpFactory]]>=               
00102 inline GUSISocketFactory * GUSIMTTcpFactory::Instance()
00103 {
00104        if (!instance)
00105               instance = new GUSIMTTcpFactory;
00106        return instance;
00107 }
00108 
00109 #endif /* GUSI_INTERNAL */
00110 
00111 #endif /* GUSI_SOURCE */
00112 
00113 #endif /* _GUSIMTTcp_ */