I use libuv because it avoid me to think ad use select/ poll etc.. and abstract the tcp async work for a lot of system. So why i need to write my own async loop when i can use libuv? the problem is that i don't know use well the libuv, and i'm searching aroung the best practice to use it. And i don't think that usage of libuv is only for application designed on it directly. For it is well developed lib.
Il giorno lunedì 7 luglio 2014 13:37:38 UTC+2, Iñaki Baz Castillo ha scritto: > > 2014-07-07 13:34 GMT+02:00 Claudio Bisegni <[email protected] > <javascript:>>: > > i agree with you, but i don't know hoe design a single loop that run and > tcp > > client allocation. > > > > I was thinking about to use uv_run in a thread using UV_RUN_ONCE and use > > read/write lock between run thread and forward thread to submit new > client > > within the loop. > > > > What do you think about that? > > > If you are thinking in threads and/or on multiple libuv loops then you > are thinking wrongly. Really. > > May I ask why you are using libuv? it is clear from your code that the > only you are doing is opening a TCP connecion, sending data, and > closing it, no more. You can do that with traditional sockets. > > libuv is designed to be the base of an application, this is, all the > application should run on the rules of the libuv loop. > > -- > Iñaki Baz Castillo > <[email protected] <javascript:>> > -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
