tcpclient(1)

πŸ“¦
version 0.88 Β· 3 versions
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… NAME πŸ’…

okay so we’re in the General Commands Manual and the main character is tcpclient(1) β€” she creates an outgoing TCP connection. that’s the whole assignment, bestie. periodt. πŸ’…


✨ SYNOPSIS ✨

tcpclient [ opts ] host port prog

🌸 DESCRIPTION 🌸

okay so real talk: opts is a series of getopt-style options. host is one argument. port is one argument. prog consists of one or more arguments. got it? iconic. 🫢

tcpclient attempts to connect to a TCP server. if it is successful, it runs prog, with descriptor 6 reading from the network and descriptor 7 writing to the network. it also sets up several environment variables β€” see tcp-environ(5). yes, she’s setting the whole vibe up for you. ✨

the server’s address is given by host and port. port may be a name from /etc/services or a number. host may be 0, referring to the local machine, or a dotted-decimal IP address, or a host name; it is fed through qualification using dns_ip4_qualify. slay.

if the server has several IP addresses, tcpclient tries each address in turn. she’s thorough like that. πŸ”₯


πŸŽ€ OPTIONS πŸŽ€

general options

  • -q β€” Quiet. do not print error messages. shhh. πŸ™ˆ
  • -Q β€” (Default.) Print error messages. yes, she will tell you what went wrong. πŸ’€
  • -v β€” Verbose. print error messages and status messages. she’s giving commentary. πŸ‘‘

connection options

  • -T x+y β€” Give up on the connection attempt after x+y seconds. Default: 2+58. when a host has several IP addresses, tcpclient tries to connect to the first IP address, waits x seconds, tries to connect to the second IP address, waits x seconds, etc.; then it retries each address that timed out, waiting y seconds per address. you may omit +y to skip the second try. before version 0.88, tcpclient(1) will use only x (default: 60). okay so that’s the timing tea. ⏳
  • -i localip β€” Use localip as the IP address for the local side of the connection; quit if localip is not available. normally tcpclient lets the operating system choose an address. she’s usually chill like that. πŸ¦‹
  • -p localport β€” Use localport as the TCP port for the local side of the connection; quit if localport is not available. normally tcpclient lets the operating system choose a port. same energy. 🌈
  • -d β€” Delay sending data for a fraction of a second whenever the remote host is responding slowly. this is currently the default, but it may not be in the future; if you want it, set it explicitly. don’t just assume she’ll keep doing it, bestie. 🫢
  • -D β€” Never delay sending data; enable TCP_NODELAY. no waiting, no drama. πŸ”₯

data-gathering options

  • -h β€” (Default.) Look up the remote host name in DNS to set the environment variable $TCPREMOTEHOST. she’s nosy in a useful way. πŸ‘€
  • -H β€” Do not look up the remote host name in DNS; remove the environment variable $TCPREMOTEHOST. bye-bye hostname lookup. πŸ’…
  • -l localname β€” Do not look up the local host name in DNS; use localname for the environment variable $TCPLOCALHOST. a common choice for localname is 0. noted. ⭐
  • -r β€” (Default.) Attempt to obtain $TCPREMOTEINFO from the remote host. she’s trying to get the info. πŸ’–
  • -R β€” Do not attempt to obtain $TCPREMOTEINFO from the remote host. no info-hunting today. πŸ™…β€β™€οΈ
  • -t n β€” Give up on the $TCPREMOTEINFO connection attempt after n seconds. Default: 26. clock’s ticking, bestie. ⏰

πŸ¦‹ SEE ALSO πŸ¦‹

and the website moment:

http://cr.yp.to/ucspi-tcp.html

xoxo, signed sealed delivered: it’s tcpclient(1) in the footer, no extra source/version/date line to spill β€” that’s the whole cute sign-off, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from