Network API
#11
(01-05-2015, 01:59 AM)jan64 Wrote: This looks great, finally there will be a way to implement irc bridge! Smile

I did already using LuaSocket. Works quite nicely, just set the timeout to 0.01 and check to make sure you got data before trying to use it :p
Reply
Thanks given by:
#12
That's a hacky way to do it. I'm talking about either coding one using asynchronous luasockets, or waiting for the asynchronous api.Tongue
Reply
Thanks given by:
#13
I'm thinking about basing this all on the libevent project: http://libevent.org/
Reply
Thanks given by:
#14
(01-05-2015, 07:22 AM)jan64 Wrote: That's a hacky way to do it. I'm talking about either coding one using asynchronous luasockets, or waiting for the asynchronous api.Tongue

but hey, it works! It'll do until the network API is created and everything.
Reply
Thanks given by:
#15
If we do use libevent, we should used the "bufferevents" API rather than the event loop, because it also supports windows IOCP.
Reply
Thanks given by:
#16
bufferevents are used within the event loop.
Reply
Thanks given by:
#17
I know, I meant using the abstraction rather than the raw network events directly.
Reply
Thanks given by:
#18
If we use libevent, will we replace the the http server with libevents implementation?
Reply
Thanks given by:
#19
It is rather undocumented, so I don't know yet. Do they have a proper parser for things like form data?
Reply
Thanks given by:
#20
Also, evhttp seems to read the entire request into memory before calling the callback; this would allow malicious clients to crash the server by sending an arbitrarily-long request. Our parser is better in this way, it parses stuff as it comes and calls callbacks, discarding data when it's been processed. I'd say we keep our http parser for the time being.
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)