version 1.15.2.1, 2006/08/16 13:08:56
|
version 1.17, 2006/06/26 22:23:29
|
|
|
#ifndef Pegasus_Socket_h | #ifndef Pegasus_Socket_h |
#define Pegasus_Socket_h | #define Pegasus_Socket_h |
| |
|
#include <cctype> |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/IPC.h> | #include <Pegasus/Common/IPC.h> |
#ifdef PEGASUS_OS_TYPE_WINDOWS |
#include <Pegasus/Common/Network.h> |
#include <windows.h> |
#include <Pegasus/Common/Linkage.h> |
# ifndef _WINSOCKAPI_ |
|
# include <winsock2.h> |
#ifdef PEGASUS_OS_OS400 |
# endif |
|
#else |
|
# include <cctype> |
|
#ifndef PEGASUS_OS_OS400 |
|
//# include <unistd.h> |
|
#else |
|
# include <Pegasus/Common/OS400ConvertChar.h> | # include <Pegasus/Common/OS400ConvertChar.h> |
# include <unistd.cleinc> |
|
#endif | #endif |
|
|
#ifdef PEGASUS_OS_ZOS | #ifdef PEGASUS_OS_ZOS |
# include <string.h> // added by rk for memcpy | # include <string.h> // added by rk for memcpy |
#endif | #endif |
# include <cstdlib> |
|
# include <errno.h> |
|
# include <fcntl.h> |
|
# include <netdb.h> |
|
# include <netinet/in.h> |
|
# include <arpa/inet.h> |
|
# include <sys/socket.h> |
|
#endif |
|
#include <Pegasus/Common/Linkage.h> |
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
#ifndef PEGASUS_SOCKET |
class Socket |
#define PEGASUS_SOCKET int |
|
#endif |
|
|
|
#ifndef PEGASUS_INVALID_SOCKET |
|
#define PEGASUS_INVALID_SOCKET -1 |
|
#endif |
|
|
|
class PEGASUS_COMMON_LINKAGE Socket |
|
{ | { |
public: | public: |
| |
|
static Sint32 read(SocketHandle socket, void* ptr, Uint32 size); |
| |
static Sint32 read(PEGASUS_SOCKET socket, void* ptr, Uint32 size); |
static Sint32 write(SocketHandle socket, const void* ptr, Uint32 size); |
|
|
static Sint32 write(PEGASUS_SOCKET socket, const void* ptr, Uint32 size); |
|
| |
static Sint32 timedWrite(PEGASUS_SOCKET socket, |
static void close(SocketHandle socket); |
const void* ptr, |
|
Uint32 size, |
|
Uint32 socketWriteTimeout); |
|
| |
static void close(PEGASUS_SOCKET socket); |
static void enableBlocking(SocketHandle socket); |
| |
static void enableBlocking(PEGASUS_SOCKET socket); |
static void disableBlocking(SocketHandle socket); |
| |
static void disableBlocking(PEGASUS_SOCKET socket); |
static void initializeInterface(); |
|
|
static void initializeInterface(void); |
|
static void uninitializeInterface(void); |
|
| |
|
static void uninitializeInterface(); |
| |
private: | private: |
|
Socket(); |
Socket() { } |
|
}; | }; |
| |
|
|
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* Pegasus_Socket_h */ | #endif /* Pegasus_Socket_h */ |