XBinder  Version 2.6.x
rtxNetUtil.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2018 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
27 #ifndef _RTXNETUTIL_H_
28 #define _RTXNETUTIL_H_
29 
30 #ifndef _OS_NOSOCKET
31 
32 #include "rtxsrc/rtxContext.h"
33 #include "rtxsrc/rtxSocket.h"
34 
35 typedef enum {
36  OSRTNetNoProto, OSRTNetHttp, OSRTNetFtp, OSRTNetOtherP
37 } OSRTNetProtocol ;
38 
39 typedef enum {
40  OSRTNetNoTrans, OSRTNetTCP, OSRTNetUDP, OSRTNetOtherT
41 } OSRTNetTransport ;
42 
43 typedef struct OSRTNETURL {
44  char* buffer; /* mutable URL buffer */
45  const char* domain;
46  const char* path;
47  int port;
48 } OSRTNETURL;
49 
50 typedef struct OSRTNETCONN {
51  OSCTXT* pctxt;
52  OSRTSOCKET socket;
53  OSRTNETURL url;
54  OSRTNETURL proxy;
55  OSRTNetProtocol protocol;
56  OSRTNetTransport transport;
57  OSBOOL dynamic;
58 } OSRTNETCONN;
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
74 EXTERNRT OSRTNETCONN* rtxNetCreateConn (OSCTXT* pctxt, const char* url);
75 
83 EXTERNRT int rtxNetCloseConn (OSRTNETCONN* pNetConn);
84 
95 EXTERNRT int rtxNetConnect (OSRTNETCONN* pNetConn);
96 
107 EXTERNRT int rtxNetInitConn
108 (OSCTXT* pctxt, OSRTNETCONN* pNetConn, const char* url);
109 
119 EXTERNRT int rtxNetParseURL (OSRTNETCONN* pNetConn, const char* url);
120 
121 EXTERNRT int rtxNetParseURL2
122 (OSRTNETCONN* pNetConn, OSRTNETURL* pNetURL, const char* url);
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif /* _OS_NOSOCKET */
129 
130 #endif
EXTERNRT OSRTNETCONN * rtxNetCreateConn(OSCTXT *pctxt, const char *url)
This function creates a new network connection to the given URL.
EXTERNRT int rtxNetParseURL(OSRTNETCONN *pNetConn, const char *url)
This function parses a Universal Resource Locator (URL) into the components defined in the network co...
int OSRTSOCKET
Socket handle type definition.
Definition: rtxSocket.h:65
Common run-time context definitions.
EXTERNRT int rtxNetCloseConn(OSRTNETCONN *pNetConn)
This function closes a network connection.
EXTERNRT int rtxNetConnect(OSRTNETCONN *pNetConn)
This function creates a network connection.
Run-time context structure.
Definition: rtxContext.h:185
EXTERNRT int rtxNetInitConn(OSCTXT *pctxt, OSRTNETCONN *pNetConn, const char *url)
This function initializes a network connection structure.