Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site oddjob.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!oddjob!matt From: matt@oddjob.UUCP (Matt Crawford) Newsgroups: net.unix-wizards,net.lan Subject: Re: STREAMS query Message-ID: <995@oddjob.UUCP> Date: Sat, 12-Oct-85 15:58:30 EDT Article-I.D.: oddjob.995 Posted: Sat Oct 12 15:58:30 1985 Date-Received: Mon, 14-Oct-85 04:28:57 EDT References: <471@enmasse.UUCP> <1699@brl-tgr.ARPA> <449@cheviot.uucp> <1542@hammer.UUCP> <2864@sun.uucp> <1554@hammer.UUCP> Reply-To: matt@oddjob.UUCP (Matt Crawford) Organization: U. Chicago, Astronomy & Astrophysics Lines: 36 Xref: watmath net.unix-wizards:15223 net.lan:1088 In article <1554@hammer.UUCP> steveg@hammer.UUCP (Steve Glaser) writes: > >Actually, an example of what I had in mind here is the accept sequence >on a passive open. In 4.2 (TCP/IP) the syscall sequence in the server >looks something like: > 1. socket() 2. bind() 3. listen() 4. accept() > >The accept blocks till a connection request is received. It returns >new file descriptor representing the *open* connection. If the server >didn't really want to talk to somebody (say it only accepts conections >from specific users), it would have to close the connection. The >client side has now seen a "connection succeed" followed by a "close >connection". > >In the ISO transport layer (ISO TP4), the server has the option of >rejecting the connection *before* the other end has seen its >"connect()" succeed. ... > >4.2 BSD does not support this cleanly. ... I betcha two new ioctl's could give 4.2 the above functions. Do a select() on a socket upon which you are listening and when a connection is available apply new ioctl #1 to peek at the address of the pending connection at the head of the listening socket's so_q. (Or getpeername() could be extended to provide this information) If the process does not want to accept it can apply the second new ioctl to drop the pending connection. Note that this will be useless in the INET domain because the SYNs are ACK'd in tcp_input() whether or not accept() has been called, so the other side sees it's connect() succeed as long as the passive side has done a listen() and the queue of pending connections is not full. _____________________________________________________ Matt University crawford@anl-mcs.arpa Crawford of Chicago ihnp4!oddjob!matt