diff options
author | Andreas Köhler <andreas.koehler@1und1.de> | 2010-11-02 14:43:03 +0100 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2010-11-10 23:46:16 +0100 |
commit | 1f1d2bd5f52ce6376ad2d9f577da5323b1582a9c (patch) | |
tree | acb7a444108a6c13a9cb9a80361a892c814ac9b3 /src/tls/tls_drv.c | |
parent | In mod_last*:get_last_iq/4, check for user resources first to return 0 second... (diff) |
Bind listener ports early and start accepting connections later
It may happen that auth or rdbms client tcp connections bind a local
socket to a port number required by a configered listener. The ejabberd
applications fails to start up and needs to be restarted.
In plain C you would bind(2) the listener port and listen(2) later on.
gen_tcp:listen/2 does not allow to separate these two steps though, so
another way is not to accept connections while start up. OTOH, the
kernel will syn/ack incoming connections and receive data, leaving them
in a buffer for the ejabberd to read from. If this is unwanted, a load
balancer would need to receive data from the ejabberd server before
adding the node to its pool.
This patch binds tcp ports while initializing the ejabberd_listener
process, storing ListenSockets in an ets table. start_listeners/0 will
reuse these ports later on.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions