Home > Support > Documentation

rtxSocket.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2007 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
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) /* 127.0.0.1 */
00061 
00062 struct in_addr;
00063 
00083 EXTERNRTX int rtxSocketAccept (OSRTSOCKET socket, OSRTSOCKET *pNewSocket, 
00084                                OSIPADDR* destAddr, int* destPort);
00085 
00096 EXTERNRTX int rtxSocketAddrToStr (OSIPADDR ipAddr, char* pbuf, size_t bufsize);
00097 
00111 EXTERNRTX int rtxSocketBind (OSRTSOCKET socket, OSIPADDR addr, int port);
00112 
00121 EXTERNRTX int rtxSocketClose (OSRTSOCKET socket);
00122 
00138 EXTERNRTX int rtxSocketConnect (OSRTSOCKET socket, const char* host, int port);
00139 
00149 EXTERNRTX int rtxSocketCreate (OSRTSOCKET* psocket);
00150 
00160 EXTERNRTX int rtxSocketGetHost (const char* host, struct in_addr *inaddr);
00161 
00169 EXTERNRTX int rtxSocketsInit ();
00170 
00186 EXTERNRTX int rtxSocketListen (OSRTSOCKET socket, int maxConnection);
00187 
00203 EXTERNRTX int rtxSocketParseURL 
00204 (char* url, char** protocol, char** address, int* port);
00205 
00218 EXTERNRTX int rtxSocketRecv (OSRTSOCKET socket, OSOCTET* pbuf, int bufsize);
00219 
00232 EXTERNRTX int rtxSocketSend (OSRTSOCKET socket, const OSOCTET* pdata, int size);
00233 
00246 EXTERNRTX int rtxSocketStrToAddr (const char* pIPAddrStr, OSIPADDR* pIPAddr);
00247 
00251 #ifdef __cplusplus
00252 }
00253 #endif
00254 
00255 #endif /* _RTXSOCKET_H_ */
00256