Am 02.02.2014 09:40, schrieb Stefan Koch:
On Sat, 01 Feb 2014 23:07:47 GMT, Jeroen Bollen wrote:
How does
listenHTTP
work internally? I understand it listens on the address you provide it in theHTTPServerSettings
object, but what happens after?I have been browsing a bit through the source code to end up in a dead end. I ended up at the
listenHTTPPlain
function, which to my understanding sets up the socket and starts listening on it usinglistenTCP
. This function seems to do nothing but call itself though. How does that work?
listenHTTPPlain
sets up a callback tohandleHTTPConnection
from there the control-flow goes tohandleRequest
and there the real fun starts
Exactly, the interesting part is in listenTCP
, which will call the
supplied callback whenever an incoming connection is established.