Am 02.02.2014 09:40, schrieb Stefan Koch:
On Sat, 01 Feb 2014 23:07:47 GMT, Jeroen Bollen wrote:
How does
listenHTTPwork internally? I understand it listens on the address you provide it in theHTTPServerSettingsobject, 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
listenHTTPPlainfunction, 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?
listenHTTPPlainsets up a callback tohandleHTTPConnectionfrom there the control-flow goes tohandleRequestand there the real fun starts
Exactly, the interesting part is in listenTCP, which will call the
supplied callback whenever an incoming connection is established.