Cuberite Forum

Full Version: Network API
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
(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
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
I'm thinking about basing this all on the libevent project: http://libevent.org/
(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.
If we do use libevent, we should used the "bufferevents" API rather than the event loop, because it also supports windows IOCP.
bufferevents are used within the event loop.
I know, I meant using the abstraction rather than the raw network events directly.
If we use libevent, will we replace the the http server with libevents implementation?
It is rather undocumented, so I don't know yet. Do they have a proper parser for things like form data?
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.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15