*BSD News Article 82145


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!uunet!in3.uu.net!news.structured.net!crusty.teleport.com!news.serv.net!not-for-mail
From: zeno@serv.net (Sean T. Lamont .)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Q. on socket() programming
Date: 1 Nov 1996 20:49:26 -0800
Organization: ServNet Internet Services, Seattle, WA
Lines: 17
Message-ID: <55ejsm$b23@itchy.serv.net>
References: <846622354snz@beckley.demon.co.uk>
NNTP-Posting-Host: itchy.serv.net

In article <846622354snz@beckley.demon.co.uk>,
Ian W Taylor  <iwta@beckley.demon.co.uk> wrote:
>If not is there a simple way of doing it other than
>getting the clients IP addr from the accept() call
>and then getting its name from gethostbyaddr(), and
>if it is not acceptable just close()ing the socket.


look at getpeername()



-- 
Sean T. Lamont, President / Chief NetNerd, Abstract Software, Inc. (ServNet)  
- Internet access * WWW hosting * TCP/IP * UNIX * NEXTSTEP * WWW Development -
email: lamont@abstractsoft.com              WWW:  http://www.serv.net
"...There's no moral, it's just a lot of stuff that happens". - H. Simpson