00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00027 #ifndef _RTXSOCKET_H_
00028 #define _RTXSOCKET_H_
00029
00030 #include "rtxsrc/rtxCommon.h"
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036 #if defined (_WIN64)
00037 typedef unsigned __int64 OSRTSOCKET;
00038 #elif defined (_WIN32)
00039 typedef unsigned int OSRTSOCKET;
00040 #else
00041 typedef int OSRTSOCKET;
00042 #endif
00043
00044 #define OSRTSOCKET_INVALID ((OSRTSOCKET)-1)
00045
00056 typedef unsigned long OSIPADDR;
00057
00058 #define OSIPADDR_ANY ((OSIPADDR)0)
00059 #define OSIPADDR_LOCAL ((OSIPADDR)0x7f000001UL)
00060
00061 struct in_addr;
00062
00082 EXTERNRTX int rtxSocketAccept (OSRTSOCKET socket, OSRTSOCKET *pNewSocket,
00083 OSIPADDR* destAddr, int* destPort);
00084
00095 EXTERNRTX int rtxSocketAddrToStr (OSIPADDR ipAddr, char* pbuf, size_t bufsize);
00096
00110 EXTERNRTX int rtxSocketBind (OSRTSOCKET socket, OSIPADDR addr, int port);
00111
00120 EXTERNRTX int rtxSocketClose (OSRTSOCKET socket);
00121
00137 EXTERNRTX int rtxSocketConnect (OSRTSOCKET socket, const char* host, int port);
00138
00148 EXTERNRTX int rtxSocketCreate (OSRTSOCKET* psocket);
00149
00159 EXTERNRTX int rtxSocketGetHost (const char* host, struct in_addr *inaddr);
00160
00168 EXTERNRTX int rtxSocketsInit ();
00169
00185 EXTERNRTX int rtxSocketListen (OSRTSOCKET socket, int maxConnection);
00186
00199 EXTERNRTX int rtxSocketRecv (OSRTSOCKET socket, OSOCTET* pbuf, int bufsize);
00200
00213 EXTERNRTX int rtxSocketSend (OSRTSOCKET socket, const OSOCTET* pdata, int size);
00214
00227 EXTERNRTX int rtxSocketStrToAddr (const char* pIPAddrStr, OSIPADDR* pIPAddr);
00228
00232 #ifdef __cplusplus
00233 }
00234 #endif
00235
00236 #endif
00237