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

Diff for /pegasus/src/Pegasus/Common/Socket.h between version 1.5.12.4 and 1.15

version 1.5.12.4, 2003/07/17 15:59:27 version 1.15, 2006/01/30 16:17:07
Line 1 
Line 1 
 //%///////////////////////-*-c++-*-/////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // The Open Group, Tivoli Systems  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 23 
Line 31 
 // //
 // Author: Mike Brasher (mbrasher@bmc.com) // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // Modified By:  // Modified By: David Dillard, Symantec Corp.  (david_dillard@symantec.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 40 
Line 48 
 #else #else
 # include <cctype> # include <cctype>
 #ifndef PEGASUS_OS_OS400 #ifndef PEGASUS_OS_OS400
 #   include <unistd.h>  //#   include <unistd.h>
 #else #else
 #   include <Pegasus/Common/OS400ConvertChar.h> #   include <Pegasus/Common/OS400ConvertChar.h>
 #   include <unistd.cleinc> #   include <unistd.cleinc>
Line 60 
Line 68 
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
   #ifndef PEGASUS_SOCKET
   #define PEGASUS_SOCKET int
   #endif
   
   #ifndef PEGASUS_INVALID_SOCKET
   #define PEGASUS_INVALID_SOCKET -1
   #endif
   
 class PEGASUS_COMMON_LINKAGE Socket class PEGASUS_COMMON_LINKAGE Socket
 { {
    public:    public:
  
  
       static Sint32 read(Sint32 socket, void* ptr, Uint32 size);        static Sint32 read(PEGASUS_SOCKET socket, void* ptr, Uint32 size);
  
       static Sint32 write(Sint32 socket, const void* ptr, Uint32 size);        static Sint32 write(PEGASUS_SOCKET socket, const void* ptr, Uint32 size);
  
       static void close(Sint32 socket);        static void close(PEGASUS_SOCKET socket);
       static int close2(Sint32 socket);  
  
       static void enableBlocking(Sint32 socket);        static void enableBlocking(PEGASUS_SOCKET socket);
       static int  enableBlocking2(Sint32 socket);  
  
       static void disableBlocking(Sint32 socket);        static void disableBlocking(PEGASUS_SOCKET socket);
       static int disableBlocking2(Sint32 socket);  
  
       static void initializeInterface(void);       static void initializeInterface(void);
       static void uninitializeInterface(void);       static void uninitializeInterface(void);
Line 89 
Line 102 
  
  
  
   
   
   
 //  <<< Thu Jul  3 13:50:29 2003 mdd >>> pep_88  
 /*****************************************************************  
  *  
  *  The socket support in pegasus is schizophrenic. Some code uses  
  *  an Sint32 (fd) as a socket, while other code uses a pointer to an  
  *  MP_Socket, which is kind of a container for either an Sint32 socket  
  *  or an SSL socket.  
  *  
  *  Then there is also the local socket. (AF_UNIX).  
  *  
  *  What we need to make all of this coherent is a general-purpose  
  *  socket class that uses polymorphism to provide a good sockets  
  *  interface.  
  *  Because of what we are planning for the pep_88 connection management  
  *  code this general-purpose socket class should be reference counted.  
  *  
  *****************************************************************/  
   
 class abstract_socket;  
 class socket_factory;  
   
   
 class PEGASUS_COMMON_LINKAGE pegasus_socket  
 {  
   
    public:  
       pegasus_socket(void);  
       pegasus_socket(socket_factory *);  
       pegasus_socket(abstract_socket *);  
       pegasus_socket(const pegasus_socket& s);  
       ~pegasus_socket(void);  
   
       pegasus_socket& operator=(const pegasus_socket& s);  
       operator Sint32() const;  
   
       int socket(int type, int style, int protocol, void *ssl_context = 0);  
   
       Sint32 read(void* ptr, Uint32 size);  
       Sint32 write(const void* ptr, Uint32 size);  
       int close(void);  
       int enableBlocking(void);  
       int disableBlocking(void);  
   
       int getsockname (struct sockaddr *addr, size_t *length_ptr);  
       int bind (struct sockaddr *addr, size_t length);  
   
       // change size_t to size_t for ZOS and windows  
       pegasus_socket accept(struct sockaddr *addr, size_t *length_ptr);  
       int connect (struct sockaddr *addr, size_t length);  
       int shutdown(int how);  
       int listen(int q);  
       int getpeername (struct sockaddr *addr, size_t *length_ptr);  
       int send (void *buffer, size_t size, int flags);  
       int recv (void *buffer, size_t size, int flags);  
       int sendto(void *buffer, size_t size, int flags, struct sockaddr *addr, size_t length);  
       int recvfrom(void *buffer, size_t size, int flags, struct sockaddr *addr, size_t *length_ptr);  
       int setsockopt (int level, int optname, void *optval, size_t optlen);  
       int getsockopt (int level, int optname, void *optval, size_t *optlen_ptr);  
   
   
       Boolean incompleteReadOccurred(Sint32 retCode);  
       Boolean is_secure(void);  
       void set_close_on_exec(void);  
   
       const char* get_err_string(void);  
   
    private:  
   
       abstract_socket * _rep;  
   
 };  
   
   
 class PEGASUS_COMMON_LINKAGE socket_factory  
 {  
    public:  
       socket_factory(void)  
       {  
       }  
   
       virtual ~socket_factory(void)  
       {  
       }  
   
       virtual abstract_socket *make_socket(void) = 0;  
 };  
   
   
 /**  
  *  factory class for creating the bsd socket object  
  **/  
 class PEGASUS_COMMON_LINKAGE bsd_socket_factory : public socket_factory  
 {  
    public:  
       bsd_socket_factory(void);  
       ~bsd_socket_factory(void);  
       abstract_socket *make_socket(void);  
 };  
   
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_Socket_h */ #endif /* Pegasus_Socket_h */


Legend:
Removed from v.1.5.12.4  
changed lines
  Added in v.1.15

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2