(file) Return to Socket.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 karl  1.11 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.10 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 karl  1.9  // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.10 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.11 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.2  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.4  // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16 mike  1.2  // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18            // 
 19 kumpf 1.4  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.2  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22 kumpf 1.4  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25 mike  1.2  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            // Author: Mike Brasher (mbrasher@bmc.com)
 31            //
 32            // Modified By:
 33            //
 34            //%/////////////////////////////////////////////////////////////////////////////
 35            
 36            #ifndef Pegasus_Socket_h
 37            #define Pegasus_Socket_h
 38            
 39            #include <Pegasus/Common/Config.h>
 40 mday  1.6  #include <Pegasus/Common/IPC.h>
 41            #ifdef PEGASUS_OS_TYPE_WINDOWS
 42            #include <windows.h>
 43            # ifndef _WINSOCKAPI_
 44            #   include <winsock2.h>
 45            # endif
 46            #else
 47            # include <cctype>
 48            #ifndef PEGASUS_OS_OS400
 49 mday  1.7  //#   include <unistd.h>
 50 mday  1.6  #else
 51            #   include <Pegasus/Common/OS400ConvertChar.h>
 52            #   include <unistd.cleinc>
 53            #endif
 54            #ifdef PEGASUS_OS_ZOS
 55            #   include <string.h>  // added by rk for memcpy
 56            #endif
 57            # include <cstdlib>
 58            # include <errno.h>
 59            # include <fcntl.h>
 60            # include <netdb.h>
 61            # include <netinet/in.h>
 62            # include <arpa/inet.h>
 63            # include <sys/socket.h>
 64            #endif
 65 kumpf 1.5  #include <Pegasus/Common/Linkage.h>
 66 marek 1.8  #ifdef PEGASUS_OS_ZOS
 67            #   include <Pegasus/Common/SocketzOS_inline.h>
 68            #endif
 69 mike  1.2  
 70            PEGASUS_NAMESPACE_BEGIN
 71            
 72 kumpf 1.3  class PEGASUS_COMMON_LINKAGE Socket
 73 mike  1.2  {
 74 mday  1.6     public:
 75 mike  1.2  
 76            
 77 mday  1.6        static Sint32 read(Sint32 socket, void* ptr, Uint32 size);
 78 mike  1.2  
 79 mday  1.6        static Sint32 write(Sint32 socket, const void* ptr, Uint32 size);
 80 mike  1.2  
 81 mday  1.6        static void close(Sint32 socket);
 82                  static int close2(Sint32 socket);
 83                  
 84                  static void enableBlocking(Sint32 socket);
 85                  static int  enableBlocking2(Sint32 socket);
 86 mike  1.2  
 87 mday  1.6        static void disableBlocking(Sint32 socket);
 88                  static int disableBlocking2(Sint32 socket);
 89 mike  1.2  
 90 mday  1.6        static void initializeInterface(void);
 91                  static void uninitializeInterface(void);
 92                  
 93 mike  1.2  
 94 mday  1.6     private:
 95 mike  1.2  
 96 mday  1.6        Socket() { }
 97            };
 98 mike  1.2  
 99            
100            
101            PEGASUS_NAMESPACE_END
102            
103            #endif /* Pegasus_Socket_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2