Generic TCP client NOTE: This code is available on the CS machines in ~hollingd/public.html/netprog/code/generictcp This is a client that uses the select() system call to watch two file descriptors for intput: a tcp socket and STDIN. Anything read from STDIN is sent to the socket, and anything that is read from the socket is sent to STDOUT. This is an example of using select(), and is also useful for testing TCP servers - just make a text file that contains the request and pipe it to this program. ----------------- The client attempts to connect to the TCP indicated by the command line parameters. The parameters are the IP address or hostname and the port number. For example, to tell the client that the server is running on the machine www.cs.rpi.edu port 80 the client should be started like this: tcpclient www.cs.rpi.edu 80 You could also put a request in a file named "req", and then do this: cat req | tcpclient www.cs.rpi.edu 80 Questions should be sent to netprog@cs.rpi.edu