Added the ReuseAddress property to the HttpServer class (Associated with pull request #73)

This commit is contained in:
sta
2014-10-20 16:00:57 +09:00
parent 4cfdd7e793
commit 7a8967bdcd
5 changed files with 50 additions and 3 deletions

View File

@@ -306,6 +306,34 @@ namespace WebSocketSharp.Server
}
}
/// <summary>
/// Gets or sets a value indicating whether the server is allowed to be bound to an address
/// that is already in use.
/// </summary>
/// <remarks>
/// If you would like to resolve to wait for socket in <c>TIME_WAIT</c> state, you should set
/// this property to <c>true</c>.
/// </remarks>
/// <value>
/// <c>true</c> if the server is allowed to be bound to an address that is already in use;
/// otherwise, <c>false</c>. The default value is <c>false</c>.
/// </value>
public bool ReuseAddress {
get {
return _listener.ReuseAddress;
}
set {
var msg = _state.CheckIfStartable ();
if (msg != null) {
_logger.Error (msg);
return;
}
_listener.ReuseAddress = value;
}
}
/// <summary>
/// Gets or sets the document root path of the server.
/// </summary>