version 1.19.2.2, 2006/07/30 19:26:30
|
version 1.24, 2007/12/18 18:50:45
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) |
|
// |
|
// Modified By: David Dillard, Symantec Corp. (david_dillard@symantec.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_Socket_h | #ifndef Pegasus_Socket_h |
|
|
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
| |
#ifdef PEGASUS_OS_OS400 |
|
# include <Pegasus/Common/EBCDIC_OS400.h> |
|
#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 |
|
|
{ | { |
public: | public: |
| |
|
/** |
|
Connects the specified socket to the specified address. If the socket |
|
is non-blocking, the connect attempt will time out after the specified |
|
interval. |
|
|
|
@param socket The socket to connect. |
|
@param address The address to which to connect the socket |
|
@param addressLength The length of the sockaddr buffer in which the |
|
address is specified. |
|
@param timeoutMilliseconds The number of milliseconds after which the |
|
connect attempt should time out, if the socket is non-blocking. |
|
@return True if the connect attempt is successful, false otherwise. |
|
*/ |
|
static Boolean timedConnect( |
|
SocketHandle socket, |
|
sockaddr* address, |
|
int addressLength, |
|
Uint32 timeoutMilliseconds); |
|
|
static Sint32 read(SocketHandle socket, void* ptr, Uint32 size); | static Sint32 read(SocketHandle socket, void* ptr, Uint32 size); |
| |
static Sint32 write(SocketHandle socket, const void* ptr, Uint32 size); | static Sint32 write(SocketHandle socket, const void* ptr, Uint32 size); |
|
|
| |
static void close(SocketHandle socket); | static void close(SocketHandle socket); |
| |
static void enableBlocking(SocketHandle socket); |
|
|
|
static void disableBlocking(SocketHandle socket); | static void disableBlocking(SocketHandle socket); |
| |
static void initializeInterface(); | static void initializeInterface(); |
| |
static void uninitializeInterface(); | static void uninitializeInterface(); |
| |
|
static SocketHandle createSocket(int domain, int type, int protocol); |
|
|
private: | private: |
Socket(); | Socket(); |
}; | }; |