Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #614

Re: Non-blocking socket operations

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!dedekind.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!shaftesbury.zen.co.uk.POSTED!not-for-mail
From Nobody <nobody@nowhere.com>
Subject Re: Non-blocking socket operations
Date Mon, 26 Sep 2011 13:02:57 +0100
User-Agent Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)
Message-Id <pan.2011.09.26.12.02.57.380000@nowhere.com>
Newsgroups comp.unix.programmer, comp.programming.threads
References <j5p1dq$8i9$1@dont-email.me>
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Lines 18
Organization Zen Internet
NNTP-Posting-Host 0264990a.news.zen.co.uk
X-Trace DXC=>Uk[SN^_;@aBPKC8bc3\Umnok4Z\<mH4ihDU:2=XKPkh>d41\0UM[KdQOMCU8L]ShgK`kC>IDNook
X-Complaints-To abuse@zen.co.uk
Xref x330-a1.tempe.blueboxinc.net comp.unix.programmer:1322 comp.programming.threads:614

Cross-posted to 2 groups.

Show key headers only | View raw


On Mon, 26 Sep 2011 10:39:11 +0530, ittium wrote:

> getaddrinfo
> -----------
> 	getaddrinfo is executed in a thread result is returned in a call back 
> and then this thread exit.
> 
> Issue- When software is doing lot of DNS lookups, lots of such threads 
> will be needed. Is there a better way of doing it.

You could use the resolver functions directly, but it's non-trivial to get
it right (e.g. re-issuing requests using TCP if a UDP query results in a
truncated response), and it will only handle lookups via DNS, not
/etc/hosts, NIS, LDAP, etc.

On Linux, you can use getaddrinfo_a(), but it isn't portable. If your
program is GPL, you can use the GNU adns library.

Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Non-blocking socket operations ittium <ittium@gmail.com> - 2011-09-26 10:39 +0530
  Re: Non-blocking socket operations Nobody <nobody@nowhere.com> - 2011-09-26 13:02 +0100
  Re: Non-blocking socket operations Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-09-26 19:10 +0100
  Re: Non-blocking socket operations William Ahern <william@wilbur.25thandClement.com> - 2011-09-26 13:44 -0700

csiph-web