* fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag.

* fhandler_socket.cc (fhandler_socket::bind): Set socket to
	SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR
	socket option, on systems supporting SO_EXCLUSIVEADDRUSE.
	* net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag
	if SO_REUSEADDR socket option has been successsfully set.
	* wincap.h (wincaps::has_exclusiveaddruse): New element.
	* wincap.cc: Implement above element throughout.
This commit is contained in:
Corinna Vinschen
2006-01-29 12:23:44 +00:00
parent 74d3f96faa
commit 5369605f4f
6 changed files with 69 additions and 16 deletions

View File

@@ -417,6 +417,7 @@ class fhandler_socket: public fhandler_base
unsigned async_io : 1; /* async I/O */
unsigned saw_shutdown_read : 1; /* Socket saw a SHUT_RD */
unsigned saw_shutdown_write : 1; /* Socket saw a SHUT_WR */
unsigned saw_reuseaddr : 1; /* Socket saw SO_REUSEADDR call */
unsigned closed : 1;
unsigned owner : 1;
unsigned connect_state : 2;
@@ -440,6 +441,7 @@ class fhandler_socket: public fhandler_base
IMPLEMENT_STATUS_FLAG (bool, async_io)
IMPLEMENT_STATUS_FLAG (bool, saw_shutdown_read)
IMPLEMENT_STATUS_FLAG (bool, saw_shutdown_write)
IMPLEMENT_STATUS_FLAG (bool, saw_reuseaddr)
IMPLEMENT_STATUS_FLAG (bool, closed)
IMPLEMENT_STATUS_FLAG (bool, owner)
IMPLEMENT_STATUS_FLAG (conn_state, connect_state)