16 #if defined(__pingtel_on_posix__) 18 #include <sys/socket.h> 19 #include <netinet/in.h> 32 #define MAX_IP_ADDRESSES 32 33 #define MAX_ADAPTER_NAME_LENGTH 256 36 #define OS_INVALID_SOCKET_DESCRIPTOR (-1) 40 # include "os/wnt/WindowsAdapterInfo.h" 41 # define OsSocketGetERRNO() (WSAGetLastError()) 42 # define OS_INVALID_INET_ADDRESS INADDR_NONE // 0xffffffff 44 #elif defined(_VXWORKS) 45 # include <os/Vxw/OsAdapterInfoVxw.h> 46 # define OsSocketGetERRNO() (errno) 47 # define OS_INVALID_INET_ADDRESS 0xffffffff 49 #elif defined(__pingtel_on_posix__) 51 # define OsSocketGetERRNO() (errno) 52 # define OS_INVALID_INET_ADDRESS 0xffffffff 55 # error Unsupported target platform. 117 virtual int write(
const char* buffer,
119 const char* ipAddress,
123 return write(buffer, bufferLength);
126 virtual int write(
const char* buffer,
int bufferLength);
136 virtual int write(
const char* buffer,
int bufferLength,
long waitMilliseconds);
142 virtual int read(
char* buffer,
int bufferLength);
151 virtual int read(
char* buffer,
int bufferLength,
163 virtual int read(
char* buffer,
int bufferLength,
164 struct in_addr* ipAddress,
int* port);
175 virtual int read(
char* buffer,
int bufferLength,
long waitMilliseconds);
181 virtual void close();
252 int* remotePort =
NULL);
258 int* remotePort =
NULL);
331 static unsigned long m_DefaultBindAddress;
349 #endif // _OsSocket_h_ static UtlBoolean socketInit()
Definition: OsSocket.cpp:790
static unsigned long getDefaultBindAddress()
Definition: OsSocket.cpp:900
Definition: OsSocket.h:79
Definition: OsSocket.h:99
unsigned long osSocketGetDefaultBindAddress()
Definition: OsSocket.cpp:123
IpProtocolSocketType
Definition: OsSocket.h:92
static UtlBoolean isFramed(IpProtocolSocketType type)
Definition: OsSocket.cpp:1300
static const char * ipProtocolString(OsSocket::IpProtocolSocketType)
return the string representation of the SocketProtocolType
Definition: OsSocket.cpp:735
virtual ~OsSocket()
Definition: OsSocket.cpp:150
virtual int getRemoteHostPort() const
Definition: OsSocket.cpp:1060
virtual int getLocalHostPort() const
Definition: OsSocket.cpp:1148
UtlBoolean mIsConnected
Definition: OsSocket.h:327
UtlString mLocalIp
Definition: OsSocket.h:323
virtual const UtlString & getLocalIp() const
Definition: OsSocket.cpp:1276
virtual int write(const char *buffer, int bufferLength, const char *ipAddress, int port)
Definition: OsSocket.h:117
virtual UtlContainableType getContainableType() const
Determine whether or not the values in a containable are comparable.
Definition: OsSocket.cpp:1324
virtual void getRemoteHostName(UtlString *remoteHostName) const
Definition: OsSocket.cpp:1054
Definition: OsSocket.h:98
virtual void close()
param: waitMilliseconds - The maximum number of milliseconds to block. This may be set to zero in whi...
Definition: OsSocket.cpp:692
static void getHostIp(UtlString *hostAddress)
Definition: OsSocket.cpp:945
virtual void setLocalIp(const UtlString &localIp)
Definition: OsSocket.h:238
virtual UtlBoolean reconnect()=0
Definition: OsSocket.h:96
virtual UtlBoolean isReadyToWrite(long waitMilliseconds=0) const
Definition: OsSocket.cpp:581
virtual void makeBlocking()
Definition: OsSocket.cpp:776
static void setDefaultBindAddress(const unsigned long bind_address)
Definition: OsSocket.cpp:893
virtual UtlBoolean isOk() const
Definition: OsSocket.cpp:1155
static unsigned long initDefaultAdapterID(UtlString &adapter_id)
Definition: OsSocket.cpp:830
#define NULL
Definition: UtlDefs.h:29
virtual int read(char *buffer, int bufferLength)
param: waitMilliseconds - The maximum number of milliseconds to block. This may be set to zero...
Definition: OsSocket.cpp:235
const char *const UtlContainableType
Definition: UtlDefs.h:70
OsAtomicLight< int > OsAtomicLightInt
Definition: OsAtomics.h:353
Definition: OsSocket.h:97
static UtlBoolean isSameHost(const char *host1, const char *host2)
Definition: OsSocket.cpp:1233
static UtlBoolean isLocalHost(const char *hostAddress)
Definition: OsSocket.cpp:1165
OsSocket()
Definition: OsSocket.cpp:131
static UtlBoolean getHostIpByName(const char *hostName, UtlString *hostAddress)
Definition: OsSocket.cpp:1065
static void inet_ntoa_pt(struct in_addr input_address, UtlString &output_address)
Definition: OsSocket.cpp:1282
virtual UtlBoolean isReadyToRead(long waitMilliseconds=0) const
Definition: OsSocket.cpp:574
Definition: UtlString.h:48
virtual void makeNonblocking()
Definition: OsSocket.cpp:762
static UtlBoolean isIp4Address(const char *address)
Definition: OsSocket.cpp:1189
int localHostPort
Definition: OsSocket.h:321
static UtlBoolean socketInitialized
Definition: OsSocket.h:84
Definition: UtlContainableAtomic.h:39
Definition: OsSocket.h:94
static const UtlContainableType TYPE
Class type used for runtime checking.
Definition: OsSocket.h:317
virtual OsSocket::IpProtocolSocketType getIpProtocol() const =0
virtual int getSocketDescriptor() const
Definition: OsSocket.cpp:888
int UtlBoolean
Definition: UtlDefs.h:41
virtual void getRemoteHostIp(struct in_addr *remoteHostAddress, int *remotePort=NULL)
Definition: OsSocket.cpp:1010
Definition: OsSocket.h:95
OsAtomicLightInt socketDescriptor
Definition: OsSocket.h:319
static void getHostName(UtlString *hostName)
Definition: OsSocket.cpp:936
int remoteHostPort
Definition: OsSocket.h:322
virtual UtlBoolean isConnected() const
Definition: OsSocket.cpp:1160
virtual UtlBoolean isReadyToReadEx(long waitMilliseconds, UtlBoolean &rSocketError) const
Definition: OsSocket.cpp:406
static OsBSem mInitializeSem
Definition: OsSocket.h:318
static void getDomainName(UtlString &domain_name)
Definition: OsSocket.cpp:907
UtlString remoteHostName
Definition: OsSocket.h:325
virtual void getLocalHostIp(UtlString *localHostAddress) const
Definition: OsSocket.cpp:1141
static UtlBoolean isMcastAddr(const char *ipAddress)
Definition: OsSocket.cpp:1221
UtlString localHostName
Definition: OsSocket.h:324
UtlString mRemoteIpAddress
Definition: OsSocket.h:326