[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Non-blocking file IO without thread possible ?
- From: "Thomas Harning Jr." <harningt@...>
- Date: Sun, 3 Sep 2006 21:34:42 -0500
I'm working on using libevnet (a server library that uses libevent)
for a proxy project for who I'm working for... I'm not sure if they
want to release it as a public library or not...
However, libevnet provides many facilities for async work...
Sockets, SSL, DNS, Threads are all exposed in such a way that
callbacks are used to notify completion. So.. for example, you want
to look up the address of something.. you can call into the DNS system
and it will call into your function when your results are in.
If you want to connect to a destination using an address that is
resolved... you setup a socket to connect to a destination that uses a
named address.. and it will resolve it for you and connect you... when
its 'done' your callback will be called.
It uses an event loop (the libevent-based one for the most part) that
you can use directly (and also be able to add timer-based callbacks if
needed) or integrate in such a way like this: <pseudocode>
while true do
-- Your stepping function
On 9/3/06, Diego Nehab <email@example.com> wrote:
> The source I have(I think 2.0.1) has unix.c commented
Uncomment it in, if you want.
> I want to learn lua and write dnscat(tunnel through
> DNS protocol) in lua. Since DNS is a request/response
> thing, the client need constant polling to allow the
> server side to send things and a blocking read on the
> client side does won't work.
Can't you do polling with LuaSocket?
Thomas Harning Jr.