Re: Sort-of Announce: Gnet, a network library




I added an asynchronous lookup function using fork and wrote a little test
program.  What I found was that blocking and nonblocking via fork took
abou the same amount of time.  My testing wasn't great: to test async, I
called inetaddr_new_nonblock many times then started the event loop.

The biggest problem was that fork would fail (not enough resources) if I
tried doing more than 200 asynchronous lookups at once.  I don't think
this will be that common, so I'm not going to worry about it now.

Solutions in order of preference to me:
- Use this techinique - it will work ok for most people, most of the time
- Use new libc functions (I don't know if there are any)
- Use adns library, either relicensed if the authors are willing, or with
    a --with-adns flag.
- Rewrite gethostbyname/gethostbyaddress from scratch.  This would take
    time.

My concern with a --with-adns flag is that people may need to have two
copies of the library to get around licensing issues.  I'd like to avoid
this.

I'll put the new code up sometime today.  There still isn't an equivelent
inet_get_name_nonblock (which calls gethostbyaddress).

David


-- 
      __          _    __ 
  ___/ /__ __  __(_)__/ /  David Helder - University of Michigan
 / _  / _ `/ |/ / / _  /   dhelder@umich.edu
 |_,_/|_,_/|___/_/|_,_/    http://www.eecs.umich.edu/~dhelder




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]