*BSD News Article 96195


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!newsfeed.nacamar.de!fu-berlin.de!irz401!orion.sax.de!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Accept()-ing a connection from a specific IP address...
Date: 26 May 1997 06:41:55 GMT
Organization: Private BSD site, Dresden
Lines: 23
Message-ID: <5mbbbj$ngq@uriah.heep.sax.de>
References: <864144757.18711@dejanews.com> <EAHuuM.129@sphynx.fdn.fr>
  <5lvqjg$7rq$1@goof.germany.eu.net> <5m7np9$ain@uriah.heep.sax.de>
  <EAq6E3.EG@sphynx.fdn.fr>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.6
X-Phone: +49-351-2012 669
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:41629

causse@sphynx.fdn.fr (Philippe Causse) wrote:

> recvfrom() cannot be applied to an unbound TCP socket, therefore you need
> to accept() before... (see pgm example in previous posting).

Right, but confirmation of the connection is actually only achieved by
reading the first data portion.  You can still reject the connection
at this step.  Except of the delay in the handling, this should be
indistingiushible from a server not running at all.

     One can obtain user connection request data without confirming the con-
     nection by issuing a recvmsg(2) call with an msg_iovlen of 0 and a non-
     zero msg_controllen, or by issuing a getsockopt(2) request.  Similarly,
     one can provide user connection rejection information by issuing a
     sendmsg(2) call with providing only the control information, or by call-
     ing setsockopt(2).

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)