This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@@ -112,11 +112,33 @@
#include<sys/un.h>
#endif
/**
* On Windows and Linux we cannot reliably bind() a socket to an
* address and port if: 1) There's already a socket bound to wildcard
* address (0.0.0.0 or ::) with the same port; 2) We try to bind()
* to wildcard address and there's another socket bound to a
* specific address and the same port.
*
* To address this problem on these two platforms we implement a
* routine that:
* 1) Checks if first attempt to bind() a new socket failed with
* EADDRINUSE.
* 2) If so, it will close the appropriate old listener connection and
* 3) Attempts bind()'ing the new listener socket again.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@@ -15,6 +15,17 @@
/* XXXX For buf_datalen in inline function */
#include"buffers.h"
/**
* This struct associates an old listener connection to be replaced
* by new connection described by port configuration. Only used when
* moving listeners to/from wildcard IP address.
*/
typedefstruct
{
connection_t *old_conn; /* Old listener connection to be replaced */
constport_cfg_t *new_port; /* New port configuration */
} listener_replacement_t;
constchar *conn_type_to_string(int type);
constchar *conn_state_to_string(int type, int state);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters