File: tcpclient.1

package info (click to toggle)
ucspi-tcp-src 0.88-15
  • links: PTS
  • area: non-free
  • in suites: lenny, squeeze
  • size: 1,380 kB
  • ctags: 761
  • sloc: ansic: 6,758; makefile: 854; sh: 312
file content (173 lines) | stat: -rw-r--r-- 3,101 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
.TH tcpclient 1
.SH NAME
tcpclient \- create an outgoing TCP connection
.SH SYNOPSIS
.B tcpclient
[
.B \-46hHrRdDqQv
]
[
.B \-i\fIlocalip
]
[
.B \-p\fIlocalport
]
[
.B \-T\fItimeoutconn
]
[
.B \-l\fIlocalname
]
[
.B \-t\fItimeoutinfo
]
[
.B \-I\fIinterface
]
.I host
.I port
.I program
[
.I arg ...
]
.SH DESCRIPTION
.B tcpclient
attempts to connect to a TCP server.
If it is successful, it runs
.I program
with the given arguments,
with descriptor 6 reading from the network
and descriptor 7 writing to the network.

The server's address is given by
.I host
and
.IR port .
.I host
may be 0, referring to the local machine,
or a dotted-decimal IP address,
or a host name;
if a host has several IP addresses,
.B tcpclient
tries each in turn.
.I port
may be a numeric port number
or a port name.

.B tcpclient
sets up several environment variables,
as described in
.B tcp-environ(5).
.SH OPTIONS
.TP
.B \-i\fIlocalip
Use
.I localip
as the IP address for the local side of the connection;
quit if
.I localip
is not available.
.TP
.B \-p\fIlocalport
Use
.I localport
as the port number for the local side of the connection;
quit if
.I localport
is not available.
.TP
.B \-I\fIinterface
Use
.I interface
as the local network interface.  This is only defined for IPv6 sockets
and needed if you use link-local IPv6 addresses.
.TP
.B \-T\fItimeoutconn
Give up on the
connection attempt
after
.I timeoutconn
seconds. Default: 60.
This timeout applies to each IP address tried.
.TP
.B \-d
(Default.)
Delay sending data for a fraction of a second whenever the
remote host is responding slowly,
to make better use of the network.
.TP
.B \-D
Never delay sending data;
enable TCP_NODELAY.
This is appropriate for interactive connections.
.TP
.B \-q
Quiet.
Do not print any messages.
.TP
.B \-Q
(Default.)
Print error messages.
.TP
.B \-v
Verbose.
Print all available messages.
.SH "DATA-GATHERING OPTIONS"
.TP
.B \-h
(Default.)
Look up the remote host name for
.BR TCPREMOTEHOST .
.TP
.B \-H
Do not look up the remote host name;
unset
.BR TCPREMOTEHOST .
.TP
.B \-l\fIlocalname
Do not look up the local host name;
use
.I localname
for
.BR TCPLOCALHOST .
.TP
.B \-r
(Default.)
Attempt to obtain
.B TCPREMOTEINFO
from the remote host.
.TP
.B \-R
Do not attempt to obtain
.B TCPREMOTEINFO
from the remote host.
.TP
.B \-t\fItimeoutinfo
Give up on the 
.B TCPREMOTEINFO
connection attempt
after
.I timeoutinfo
seconds. Default: 26.
.TP
.B \-4
Fall back to IPv4 sockets.  This is necessary for terminally broken
systems like OpenBSD which will not let IPv6 sockets connect to
V4-mapped IPv6 addresses.  Please note that this also applies to DNS
lookups, so you will have to use an DNS resolver with an IPv6 address to
connect to IPv6 systems.  Use \fBDNSCACHEIP\fR to set the DNS resolver
IP dynamically.
.TP
.B \-6
Force IPv6 mode in UCSPI environment variables, even for
IPv4 connections.  This will set \fB$PROTO\fR to \fBTCP6\fR and put
IPv4-mapped IPv6 addresses in \fBTCPLOCALIP\fR and \fBTCPREMOTEIP\fR.
.SH "SEE ALSO"
date@(1),
finger@(1),
http@(1),
mconnect(1),
tcpcat(1),
tcpserver(1),
who@(1),
tcp-environ(5)