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

Diff for /pegasus/src/Pegasus/Common/Socket.cpp between version 1.10 and 1.11

version 1.10, 2003/08/12 18:02:41 version 1.11, 2003/08/14 22:01:27
Line 41 
Line 41 
 #else #else
 #   include <unistd.cleinc> #   include <unistd.cleinc>
 #endif #endif
 #ifdef PEGASUS_OS_ZOS  
 #   include <string.h>  // added by rk for memcpy #   include <string.h>  // added by rk for memcpy
 #endif  
 # include <cstdlib> # include <cstdlib>
 # include <errno.h> # include <errno.h>
 # include <fcntl.h> # include <fcntl.h>
Line 51 
Line 49 
 # include <netinet/in.h> # include <netinet/in.h>
 # include <arpa/inet.h> # include <arpa/inet.h>
 # include <sys/socket.h> # include <sys/socket.h>
   # include <errno.h>
 #endif #endif
  
   #include <Pegasus/Common/Sharable.h>
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 static Uint32 _socketInterfaceRefCount = 0; static Uint32 _socketInterfaceRefCount = 0;
Line 66 
Line 66 
     __atoe_l((char *)ptr,size);     __atoe_l((char *)ptr,size);
     return i;     return i;
 #else #else
   
   #if defined (__GNUC__)
       int ccode = TEMP_FAILURE_RETRY(::read(socket, (char*)ptr, size));
       return ccode;
   #else
     return ::read(socket, (char*)ptr, size);     return ::read(socket, (char*)ptr, size);
 #endif #endif
   #endif
 } }
  
 Sint32 Socket::write(Sint32 socket, const void* ptr, Uint32 size) Sint32 Socket::write(Sint32 socket, const void* ptr, Uint32 size)
Line 83 
Line 89 
     free(ptr2);     free(ptr2);
     return i;     return i;
 #else #else
   #if (__GNUC__)
       int ccode = TEMP_FAILURE_RETRY(::write(socket, (char*)ptr, size));
       return ccode;
   #else
     return ::write(socket, (char*)ptr, size);     return ::write(socket, (char*)ptr, size);
 #endif #endif
   #endif
 } }
  
 void Socket::close(Sint32 socket) void Socket::close(Sint32 socket)
Line 92 
Line 103 
 #ifdef PEGASUS_OS_TYPE_WINDOWS #ifdef PEGASUS_OS_TYPE_WINDOWS
     closesocket(socket);     closesocket(socket);
 #else #else
   #if (__GNUC__)
       TEMP_FAILURE_RETRY(::close(socket));
   #else
     ::close(socket);     ::close(socket);
 #endif #endif
   #endif
 } }
  
   int Socket::close2(Sint32 socket)
   {
   #ifdef PEGASUS_OS_TYPE_WINDOWS
       return closesocket(socket);
   #else
   #if (__GNUC__)
       int ccode = TEMP_FAILURE_RETRY(::close(socket));
       return ccode;
   #else
       return ::close(socket);
   #endif
   #endif
   }
   
   
 void Socket::enableBlocking(Sint32 socket) void Socket::enableBlocking(Sint32 socket)
 { {
 #ifdef PEGASUS_OS_TYPE_WINDOWS #ifdef PEGASUS_OS_TYPE_WINDOWS
Line 108 
Line 138 
 #endif #endif
 } }
  
   int Socket::enableBlocking2(Sint32 socket)
   {
   #ifdef PEGASUS_OS_TYPE_WINDOWS
       unsigned long flag = 0;
       return ioctlsocket(socket, FIONBIO, &flag);
   #else
       int flags = fcntl(socket, F_GETFL, 0);
       flags &= ~O_NONBLOCK;
       return fcntl(socket, F_SETFL, flags);
   #endif
   }
   
 void Socket::disableBlocking(Sint32 socket) void Socket::disableBlocking(Sint32 socket)
 { {
 #ifdef PEGASUS_OS_TYPE_WINDOWS #ifdef PEGASUS_OS_TYPE_WINDOWS
Line 120 
Line 162 
 #endif #endif
 } }
  
   int Socket::disableBlocking2(Sint32 socket)
   {
   #ifdef PEGASUS_OS_TYPE_WINDOWS
       unsigned long flag = 1;
       return ioctlsocket(socket, FIONBIO, &flag);
   #else
       int flags = fcntl(socket, F_GETFL, 0);
       flags |= O_NONBLOCK;
       return fcntl(socket, F_SETFL, flags);
   #endif
   }
   
 void Socket::initializeInterface() void Socket::initializeInterface()
 { {
 #ifdef PEGASUS_OS_TYPE_WINDOWS #ifdef PEGASUS_OS_TYPE_WINDOWS
Line 145 
Line 199 
 #endif #endif
 } }
  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
   


Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2