rtxSocket.h
Go to the documentation of this file.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/osSysTypes.h"
00031 #include "rtxsrc/rtxExternDefs.h"
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037 #if defined (_WIN64) && !defined(__SYMBIAN32__)
00038 typedef unsigned __int64 OSRTSOCKET;
00039 #elif defined (_WIN32) && !defined(__SYMBIAN32__)
00040 typedef unsigned int OSRTSOCKET;
00041 #else
00042 typedef int OSRTSOCKET;
00043 #endif
00044
00045 #define OSRTSOCKET_INVALID ((OSRTSOCKET)-1)
00046
00057 typedef unsigned long OSIPADDR;
00058
00059 #define OSIPADDR_ANY ((OSIPADDR)0)
00060 #define OSIPADDR_LOCAL ((OSIPADDR)0x7f000001UL)
00061
00062 struct in_addr;
00063
00083 EXTERNRT int rtxSocketAccept (OSRTSOCKET socket, OSRTSOCKET *pNewSocket,
00084 OSIPADDR* destAddr, int* destPort);
00085
00096 EXTERNRT int rtxSocketAddrToStr (OSIPADDR ipAddr, char* pbuf, size_t bufsize);
00097
00111 EXTERNRT int rtxSocketBind (OSRTSOCKET socket, OSIPADDR addr, int port);
00112
00121 EXTERNRT int rtxSocketClose (OSRTSOCKET socket);
00122
00138 EXTERNRT int rtxSocketConnect (OSRTSOCKET socket, const char* host, int port);
00139
00148 EXTERNRT int rtxSocketCreate (OSRTSOCKET* psocket);
00149
00150
00151
00152
00153
00154
00155
00156
00157 EXTERNRT int rtxSocketCreateUDP (OSRTSOCKET *psocket);
00158
00168 EXTERNRT int rtxSocketGetHost (const char* host, struct in_addr *inaddr);
00169
00177 EXTERNRT int rtxSocketsInit ();
00178
00194 EXTERNRT int rtxSocketListen (OSRTSOCKET socket, int maxConnection);
00195
00211 EXTERNRT int rtxSocketParseURL
00212 (char* url, char** protocol, char** address, int* port);
00213
00226 EXTERNRT int rtxSocketRecv (OSRTSOCKET socket, OSOCTET* pbuf, int bufsize);
00227
00240 EXTERNRT int rtxSocketSend (OSRTSOCKET socket, const OSOCTET* pdata, int size);
00241
00254 EXTERNRT int rtxSocketStrToAddr (const char* pIPAddrStr, OSIPADDR* pIPAddr);
00255
00259 #ifdef __cplusplus
00260 }
00261 #endif
00262
00263 #endif
00264