httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan T. Leighton" <>
Subject Re: Can a module control the socket transport protocol? - revisited
Date Fri, 08 Nov 2013 01:17:00 GMT
I think the answer to my question is sort of, but not really. It appears 
that httpd can support alternate network transport protocols within 
strict limits. The MPMs (at least prefork, worker, and event), all call 
ap_setup_listeners() to set various socket options, bind(), and listen() 
on all the sockets in the global variable ap_listeners, before setting 
up polling. If you want to use something other than TCP, and if you're 
content to, and able to, have your sockets use the same socket option 
settings, bind(), and listen() calls that are used for TCP sockets, then 
you just need to create a configuration command that creates and adds 
your sockets to ap_listeners.

There is an additional concern that the Listen configuration command 
naturally assumes it's the only game in town. When it tries to reuse old 
listeners, it only checks the address and port - not the transport 
protocol. Thus, it could try to reuse a TCP socket that you wanted 
changed to another protocol, or vice verse.

This isn't really supporting alternate network transport protocols.

- Jon Leighton

On 11/6/13 4:13 PM, Jon Leighton wrote:
> I'm revisiting this question (from several months ago), primarily 
> because I know more now that I did then - though still not enough. :)
> There are a couple places in the httpd code that state or imply that 
> httpd is not restricted to TCP - that other network transport 
> protocols can be used. In particular, core.c:register_hooks() 
> explicitly mentions other modules installing alternate network 
> transports, and http_connection.h mentions the 
> "install_network_transport" hook. I haven't been able to find any 
> information at all on the "install_network_transport" hook, and I'm 
> wondering if the comment is actually meant to refer to alternatives to 
> HTTP, rather than TCP.
> I'm also wondering if the comment in core.c refers only to the "core" 
> being network transport agnostic, and implies nothing about the MPMs, 
> which appear to me to be effectively hard coded to TCP.
> Is it possible to add a loadable module to an MPM? If not, then it 
> seems like the only option is to create my own MPM. If so, then the 
> trick would be to get any sockets I create into the MPM's list of 
> listening sockets, so they can be polled - but even that doesn't seem 
> possible. The problem as I see it is that one of the key variables 
> (the number of listening sockets), is private to the MPM.
> Does anyone really know if httpd can support alternate transport 
> protocols? Does the comment in core.c simply indicate that the "core" 
> is network transport agnostic, and imply nothing about the MPMs?
> Thanks for any help/comments on this.
> - Jon Leighton

View raw message