Reset blockEvent on connect.

This commit is contained in:
RogueException
2015-09-07 15:49:13 -03:00
parent 09a0c74049
commit a9445d60dd

View File

@@ -56,7 +56,7 @@ namespace Discord
/// <summary> Initializes a new instance of the DiscordClient class. </summary> /// <summary> Initializes a new instance of the DiscordClient class. </summary>
public DiscordClient(DiscordClientConfig config = null) public DiscordClient(DiscordClientConfig config = null)
{ {
_blockEvent = new ManualResetEventSlim(true); _blockEvent = new ManualResetEventSlim(false);
_config = config ?? new DiscordClientConfig(); _config = config ?? new DiscordClientConfig();
_isDebugMode = _config.EnableDebug; _isDebugMode = _config.EnableDebug;
_rand = new Random(); _rand = new Random();
@@ -534,6 +534,7 @@ namespace Discord
private async Task<string> ConnectInternal(string token) private async Task<string> ConnectInternal(string token)
{ {
_blockEvent.Reset();
_http.Token = token; _http.Token = token;
string url = (await _api.GetWebSocketEndpoint()).Url; string url = (await _api.GetWebSocketEndpoint()).Url;
if (_isDebugMode) if (_isDebugMode)