29 #ifndef _OSRTSOCKET_H_ 30 #define _OSRTSOCKET_H_ 36 #pragma warning(disable: 4514) 58 inline OSBOOL isInitialized () {
return mInitStatus == 0; }
80 EXTRTMETHOD OSRTSocket
81 (
OSRTSOCKET socket, OSBOOL ownership = FALSE,
int retryCount = 1);
87 EXTRTMETHOD OSRTSocket (
const OSRTSocket& socket);
93 EXTRTMETHOD ~OSRTSocket ();
111 EXTRTMETHOD OSRTSocket* accept (
OSIPADDR* destIP = 0,
int *port = 0);
123 EXTRTMETHOD
static const char* addrToString
124 (
OSIPADDR ipAddr,
char* pAddrStr,
size_t bufsize);
140 EXTRTMETHOD
int bind (
OSIPADDR addr,
int port);
154 EXTRTMETHOD
int bindUrl (
const char* url);
172 EXTRTMETHOD
int bind (
const char* pAddrStr,
int port);
188 return bind (OSIPADDR_ANY, port);
202 EXTRTMETHOD
int blockingRead (OSOCTET* pbuf,
size_t readBytes);
212 EXTRTMETHOD
int close ();
229 EXTRTMETHOD
int connect (
const char* host,
int port);
246 EXTRTMETHOD
int connectTimed (
const char* host,
int port,
int nsecs);
259 EXTRTMETHOD
int connectUrl (
const char* url);
296 EXTRTMETHOD
int listen (
int maxConnections);
311 EXTRTMETHOD
int recv (OSOCTET* pbuf,
size_t bufsize);
325 EXTRTMETHOD
int send (
const OSOCTET* pdata,
size_t size);
358 EXTRTMETHOD
static OSIPADDR stringToAddr (
const char* pAddrStr);
365 #endif //_OSRTSOCKET_H_ OSBOOL mOwner
indicates this class owns the socket
Definition: OSRTSocket.h:56
OSBOOL getOwnership()
Definition: OSRTSocket.h:267
int OSRTSOCKET
Definition: rtxSocket.h:65
void setRetryCount(int value)
Definition: OSRTSocket.h:345
void setOwnership(OSBOOL ownership)
Definition: OSRTSocket.h:336
OSRTSOCKET mSocket
handle of the socket
Definition: OSRTSocket.h:52
int getStatus()
Definition: OSRTSocket.h:283
int mRetryCount
number of time to retry socker connect
Definition: OSRTSocket.h:55
Definition: OSRTSocket.h:50
unsigned long OSIPADDR
Definition: rtxSocket.h:80
OSRTSOCKET getSocket() const
Definition: OSRTSocket.h:274
int bind(int port)
Definition: OSRTSocket.h:187