Date: Fri, 7 Nov 2003 12:35:55 -0500 From: Charles Swiger <cswiger@mac.com> To: Chris Pressey <cpressey@catseye.mine.nu> Cc: FreeBSD-Questions <freebsd-questions@freebsd.org> Subject: Re: [OT?] Tying a socket to stdin/stdout w/dup2() ? Message-ID: <D7649704-1148-11D8-AD24-003065ABFD92@mac.com> In-Reply-To: <20031107091909.6d2a0acc.cpressey@catseye.mine.nu> References: <20031107091909.6d2a0acc.cpressey@catseye.mine.nu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 7, 2003, at 12:19 PM, Chris Pressey wrote: > I've got a C program that opens a TCP/IP socket and makes a client > connection. What I'd like to do is to 'tie' the socket to this > program's standard I/O, so that anything that is fed into this > program's > stdin, is immediately sent to the socket, and anything that appears on > the socket, is immediately sent out this program's stdout. (The end > effect being a sort of pathologically simple version of what telnet, > (or inetd or ucspi-tcp) does.) Take a look at netcat, from /usr/ports/net/netcat. -- -Chuck
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D7649704-1148-11D8-AD24-003065ABFD92>