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


Groups > comp.unix.programmer > #1326

Re: Non-blocking socket operations

Message-ID <6q47l8-5fa.ln1@wilbur.25thandClement.com> (permalink)
From William Ahern <william@wilbur.25thandClement.com>
Subject Re: Non-blocking socket operations
Newsgroups comp.unix.programmer, comp.programming.threads
References <j5p1dq$8i9$1@dont-email.me>
Date 2011-09-26 13:44 -0700

Cross-posted to 2 groups.

Show all headers | View raw


ittium <ittium@gmail.com> wrote:
<snip>
> 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.

I generally don't like pimping my warez, but IMNSHO you might want to try
this:

	http://25thandclement.com/~william/projects/dns.c.html

See resolve_addrinfo() at the bottom of the source file for an example of
how to use the struct addrinfo-based API.

I've used c-ares, ADNS, etc for years. They were all poorly designed, IMHO.
They worked sort-of-okay for simple A lookups, but were a PITA for anything
more sophisticated. Plus, I hated being forced to use callbacks.

Back to comp.unix.programmer | Previous | Next — Previous 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