Hello!
On Tue, Aug 9, 2016 at 10:35 AM, Mike Lowry wrote:
> In attempting to build an application within the OpenResty environment, I am
> still a bit fuzzy on the relationship between ports, connections and
> application processes. A websocket connection remains open for (possibly)
> extended period. Does this mean that a port is occupied or a process thread
> remains open for the entire time, or is there an event mechanism that will
> fire up when a new message is received?
OpenResty uses I/O multiplexing so it's just socket overhead and port
occupation. No OS threads nor OS processes are blocked on such slow or
idle connections. When a new message is received, it will trigger a
read event returned by the epoll_wait() syscall (or something similar,
depending on your OS and configurations), which sits at the core of
the nginx event loop.
Regards,
-agentzh