Path: utzoo!attcan!uunet!cme!libes From: libes@cme.nist.gov (Don Libes) Newsgroups: comp.unix.questions Subject: Re: TCP programming question Message-ID: <4882@muffin.cme.nist.gov> Date: 29 Jun 90 18:26:25 GMT References: Reply-To: libes@cme.nist.gov (Don Libes) Distribution: comp Organization: National Institute of Standards and Technology Lines: 32 In article rcb@ccpv1.cc.ncsu.edu (Randy Buckland) writes: >I have a program that is trying to use "select" to listen to a pipe, >a tcp socket with a known port number and any number of active "connected" >tcp circuits. I would like select to complete when another process issues >a connect request for the tcp socket with the known port number and select >would indicate that file as having activity. I am setting the select >bitmasks for read and exceptions for all files involved. I thought that >a connect request would read as an exception, but I get nothing. No, it comes in as a read (on the server's connection_socket). >Any ideas? I want to be handling other data and when a connect comes in, >I would like to accept that connection and add the new file to the list of >active circuits. Make this easy on yourself and ftp pub/sized_io.shar.Z from durer.cme.nist.gov (or mail "send pub/sized_io.shar.Z to library@ the same host.) It is a library of networking utilities. One is a function defined as: int client = select_server_stream(s,&fds); int s; fd_set fds; select_server_stream() receives data or connections, and handles client deaths. s is the server's connection socket. fds is the fd_set required by select(). It includes some other utilities as well as a paper I wrote called "Packet-Oriented Communications Using a Stream Protocol --or-- Making TCP/IP on Berkeley UNIX a Little More Pleasant to Use". Enjoy. Don Libes libes@cme.nist.gov ...!uunet!cme-durer!libes