httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: support for multiple tcp/udp ports
Date Thu, 29 Nov 2001 20:27:36 GMT
On Thursday 29 November 2001 12:12 pm, Michal Szymaniak wrote:
> Hello again.
> > It is now possible to write a module that will make Apache listen on
> > UDP ports.  However, as somebody who has done this in the past,
> > it's not a good idea.  You lose too much data on every request.
> Could you explain what you mean by saying 'you lose data'? Is it losing
> data because of lack of reliability in udp, or missing datagrams that
> arrive to your udp socket and are subsequently overwritten by next ones
> before you manage to service them?

I am assuming it was because of the reliability of udp, but we ran out of time
on the project before we figured out exactly what was happening, and I
never got back to it.

> Anyway, I have tried to modify the echo module to manage additonal
> sockets: I added post_config hook that created new sockets together
> with associated apr_listen_rec structures and then simply inserted them
> into the 'ap_listeners' list. As long as the sockets were tcp-oriented,
> everything was just fine. However, after switching from SOCK_STREAM to
> SOCK_DGRAM, apache exited with a critical error, leaving (in 'error_log')
> a few lines about 'invalid operations on non-tcp socket'.

You are adding the sockets too early.  There are two ways to handle this.

1)  Use the pre_mpm hook instead of post_config.
2)  We need a new hook

If you look at the worker MPM, you will see that it actually adds a pipe
to the listen_rec list, but it doesn't use a hook to do it.  Can you modify 
your code to use the pre_mpm hook, and let me know if that works?  Even
if it does, we may need a new hook, because the pre_mpm hook doesn't
get called for graceful restarts.

Ryan Bloom
Covalent Technologies

View raw message