1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 |
<!-- saved from url=(0065)http://www.interlog.com/~calex/software/source/include/tcp_util.h --> |
3 |
<HTML><HEAD> |
4 |
<META content="text/html; charset=windows-1252" http-equiv=Content-Type> |
5 |
<META content="MSHTML 5.00.3105.105" name=GENERATOR></HEAD> |
6 |
<BODY><XMP>/* |
7 |
@(#) FILE: tcp_util.h RELEASE: 1.7 DATE: 11/05/96, 15:03:41 |
8 |
*/ |
9 |
/******************************************************************************* |
10 |
|
11 |
tcp_util.h |
12 |
|
13 |
TCP Utility Definitions. |
14 |
|
15 |
*******************************************************************************/ |
16 |
|
17 |
#ifndef TCP_UTIL_H /* Has the file been INCLUDE'd already? */ |
18 |
#define TCP_UTIL_H yes |
19 |
|
20 |
#ifdef __cplusplus |
21 |
extern "C" { |
22 |
#endif |
23 |
|
24 |
|
25 |
#include "ansi_setup.h" /* ANSI or non-ANSI C? */ |
26 |
#include "skt_util.h" /* Socket support functions. */ |
27 |
|
28 |
|
29 |
/******************************************************************************* |
30 |
TCP Network Endpoint (Client View) and Definitions. |
31 |
*******************************************************************************/ |
32 |
|
33 |
/* Endpoint handle. */ |
34 |
typedef struct _TcpEndpoint *TcpEndpoint ; |
35 |
|
36 |
|
37 |
/******************************************************************************* |
38 |
Miscellaneous declarations. |
39 |
*******************************************************************************/ |
40 |
|
41 |
extern int tcp_util_debug ; /* Global debug switch (1/0 = yes/no). */ |
42 |
|
43 |
|
44 |
/******************************************************************************* |
45 |
Public functions. |
46 |
*******************************************************************************/ |
47 |
|
48 |
extern int tcpAnswer P_((TcpEndpoint listeningPoint, |
49 |
double timeout, |
50 |
TcpEndpoint *dataPoint)) ; |
51 |
|
52 |
extern int tcpCall P_((const char *serverName, |
53 |
int noWait, |
54 |
TcpEndpoint *dataPoint)) ; |
55 |
|
56 |
extern int tcpComplete P_((TcpEndpoint dataPoint, |
57 |
double timeout, |
58 |
int destroyOnError)) ; |
59 |
|
60 |
extern int tcpDestroy P_((TcpEndpoint port)) ; |
61 |
|
62 |
extern int tcpFd P_((TcpEndpoint endpoint)) ; |
63 |
|
64 |
extern int tcpIsReadable P_((TcpEndpoint dataPoint)) ; |
65 |
|
66 |
extern int tcpIsUp P_((TcpEndpoint dataPoint)) ; |
67 |
|
68 |
extern int tcpIsWriteable P_((TcpEndpoint dataPoint)) ; |
69 |
|
70 |
extern int tcpListen P_((const char *portName, |
71 |
int backlog, |
72 |
TcpEndpoint *listeningPoint)) ; |
73 |
|
74 |
extern char *tcpName P_((TcpEndpoint endpoint)) ; |
75 |
|
76 |
extern int tcpRead P_((TcpEndpoint dataPoint, |
77 |
double timeout, |
78 |
int numBytesToRead, |
79 |
char *buffer, |
80 |
int *numBytesRead)) ; |
81 |
|
82 |
extern int tcpRequestPending P_((TcpEndpoint listeningPoint)) ; |
83 |
|
84 |
#define tcpSetBuf(endpoint, receiveSize, sendSize) \ |
85 |
sktSetBuf (tcpName (endpoint), tcpFd (endpoint), receiveSize, sendSize) |
86 |
|
87 |
extern int tcpWrite P_((TcpEndpoint dataPoint, |
88 |
double timeout, |
89 |
int numBytesToWrite, |
90 |
const char *buffer, |
91 |
int *numBytesWritten)) ; |
92 |
|
93 |
|
94 |
#ifdef __cplusplus |
95 |
} |
96 |
#endif |
97 |
|
98 |
#endif /* If this file was not INCLUDE'd previously. */ |
99 |
</XMP></BODY></HTML> |