Fix a few for pull request #73
This commit is contained in:
parent
3f7e2ab69f
commit
532b818e2e
@ -31,7 +31,8 @@
|
|||||||
#region Contributors
|
#region Contributors
|
||||||
/*
|
/*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Juan Manuel Lallana <juan.manuel.lallana@gmail.com>
|
* - Juan Manuel Lallana <juan.manuel.lallana@gmail.com>
|
||||||
|
* - Jonas Hovgaard <j@jhovgaard.dk>
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -66,12 +67,12 @@ namespace WebSocketSharp.Server
|
|||||||
private int _port;
|
private int _port;
|
||||||
private string _realm;
|
private string _realm;
|
||||||
private Thread _receiveRequestThread;
|
private Thread _receiveRequestThread;
|
||||||
|
private bool _reuseAddress;
|
||||||
private bool _secure;
|
private bool _secure;
|
||||||
private WebSocketServiceManager _services;
|
private WebSocketServiceManager _services;
|
||||||
private volatile ServerState _state;
|
private volatile ServerState _state;
|
||||||
private object _sync;
|
private object _sync;
|
||||||
private Uri _uri;
|
private Uri _uri;
|
||||||
private bool _reuseAddress;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -418,6 +419,36 @@ 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 _reuseAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
set {
|
||||||
|
if (!canSet ("ReuseAddress"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (value ^ _reuseAddress) {
|
||||||
|
_listener.Server.SetSocketOption (
|
||||||
|
SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, value);
|
||||||
|
|
||||||
|
_reuseAddress = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the delegate called to find the credentials for an identity used to
|
/// Gets or sets the delegate called to find the credentials for an identity used to
|
||||||
/// authenticate a client.
|
/// authenticate a client.
|
||||||
@ -452,39 +483,6 @@ 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 <c>TIME_WAIT</c>, 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 _reuseAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (!canSet("ReuseAddress"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (value ^ _reuseAddress)
|
|
||||||
{
|
|
||||||
_listener.Server.SetSocketOption(
|
|
||||||
SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, value);
|
|
||||||
|
|
||||||
_reuseAddress = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
@ -874,6 +872,7 @@ namespace WebSocketSharp.Server
|
|||||||
|
|
||||||
_state = ServerState.Stop;
|
_state = ServerState.Stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user