version 1.9.4.5, 2003/07/10 21:41:12
|
version 1.9.4.7, 2003/08/13 19:39:50
|
|
|
#ifndef PEGASUS_OS_OS400 | #ifndef PEGASUS_OS_OS400 |
# include <unistd.h> | # include <unistd.h> |
#else | #else |
# include <Pegasus/Common/OS400ConvertChar.h> |
|
# include <unistd.cleinc> | # include <unistd.cleinc> |
#endif | #endif |
# include <string.h> // added by rk for memcpy | # include <string.h> // added by rk for memcpy |
|
|
return ::recv(socket, (char*)ptr, size, 0); | return ::recv(socket, (char*)ptr, size, 0); |
#elif defined(PEGASUS_OS_ZOS) | #elif defined(PEGASUS_OS_ZOS) |
int i=::read(socket, (char*)ptr, size); | int i=::read(socket, (char*)ptr, size); |
#ifdef PEGASUS_HAVE_EBCDIC |
|
__atoe_l((char *)ptr,size); | __atoe_l((char *)ptr,size); |
#endif |
|
return i; |
|
#elif defined(PEGASUS_OS_OS400) |
|
int i=::read(socket, (char*)ptr, size); |
|
AtoE((char *)ptr, size); |
|
return i; | return i; |
#else | #else |
| |
|
|
char * ptr2 = (char *)malloc(size); | char * ptr2 = (char *)malloc(size); |
int i; | int i; |
memcpy(ptr2,ptr,size); | memcpy(ptr2,ptr,size); |
#ifdef PEGASUS_HAVE_EBCDIC |
|
__etoa_l(ptr2,size); | __etoa_l(ptr2,size); |
#endif |
|
i = ::write(socket, ptr2, size); |
|
free(ptr2); |
|
return i; |
|
#elif defined(PEGASUS_OS_OS400) |
|
char * ptr2 = (char *)malloc(size); |
|
int i; |
|
memcpy(ptr2,ptr,size); |
|
EtoA(ptr2,size); |
|
i = ::write(socket, ptr2, size); | i = ::write(socket, ptr2, size); |
free(ptr2); | free(ptr2); |
return i; | return i; |
|
|
}; | }; |
| |
| |
class PEGASUS_COMMON_LINKAGE socket_factory |
|
{ |
|
public: |
|
socket_factory(void) |
|
{ |
|
} |
|
|
|
virtual ~socket_factory(void) |
|
{ |
|
} |
|
|
|
virtual abstract_socket *make_socket(void) = 0; |
|
}; |
|
|
|
|
|
| |
/** | /** |
* null socket class - | * null socket class - |
|
|
} | } |
| |
| |
/** |
bsd_socket_factory::bsd_socket_factory(void) |
* 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) |
|
|
bsd_socket_factory::~bsd_socket_factory(void) |
{ | { |
} | } |
| |
abstract_socket *make_socket(void) |
abstract_socket* bsd_socket_factory::make_socket(void) |
{ | { |
return new bsd_socket_rep(); | return new bsd_socket_rep(); |
} | } |
}; |
|
| |
| |
| |
|
|
return _rep->operator Sint32(); | return _rep->operator Sint32(); |
} | } |
| |
|
|
int pegasus_socket::socket(int type, int style, int protocol) |
|
{ |
|
return _rep->socket(type, style, protocol); |
|
} |
|
|
|
int pegasus_socket::socket(int type, int style, int protocol, void *ssl_context) | int pegasus_socket::socket(int type, int style, int protocol, void *ssl_context) |
{ | { |
return _rep->socket(type, style, protocol, ssl_context); | return _rep->socket(type, style, protocol, ssl_context); |