Compare commits

...

2 Commits
dev ... 2.4.1

Author SHA1 Message Date
  Paulo 15910a1149
misc: Hopefully deploy to MyGet 4 years ago
  Paulo 9ed32c81a6 Bump to 2.4.1 and add deadlock changes 4 years ago
6 changed files with 34 additions and 42 deletions
Split View
  1. +2
    -2
      Discord.Net.targets
  2. +2
    -3
      azure-pipelines.yml
  3. +1
    -15
      src/Discord.Net.WebSocket/ConnectionManager.cs
  4. +2
    -2
      src/Discord.Net.WebSocket/DiscordSocketApiClient.cs
  5. +11
    -4
      src/Discord.Net.WebSocket/Net/DefaultWebSocketClient.cs
  6. +16
    -16
      src/Discord.Net/Discord.Net.nuspec

+ 2
- 2
Discord.Net.targets View File

@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>2.4.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>2.4.1</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>
<LangVersion>latest</LangVersion>
<Authors>Discord.Net Contributors</Authors>
<PackageTags>discord;discordapp</PackageTags>


+ 2
- 3
azure-pipelines.yml View File

@@ -21,7 +21,7 @@ jobs:
- job: Windows_build
pool:
vmImage: 'windows-latest'
condition: ne(variables['Build.SourceBranch'], 'refs/heads/dev')
condition: ne(variables['Build.SourceBranch'], 'refs/heads/2.4.1')
steps:
- template: azure/build.yml

@@ -32,11 +32,10 @@ jobs:
and (
succeeded(),
or (
eq(variables['Build.SourceBranch'], 'refs/heads/dev'),
eq(variables['Build.SourceBranch'], 'refs/heads/2.4.1'),
eq(variables['buildTag'], True)
)
)
steps:
- template: azure/build.yml
- template: azure/deploy.yml
- template: azure/docs.yml

+ 1
- 15
src/Discord.Net.WebSocket/ConnectionManager.cs View File

@@ -75,11 +75,6 @@ namespace Discord
nextReconnectDelay = 1000; //Reset delay
await _connectionPromise.Task.ConfigureAwait(false);
}
catch (OperationCanceledException ex)
{
Cancel(); //In case this exception didn't come from another Error call
await DisconnectAsync(ex, !reconnectCancelToken.IsCancellationRequested).ConfigureAwait(false);
}
catch (Exception ex)
{
Error(ex); //In case this exception didn't come from another Error call
@@ -143,16 +138,7 @@ namespace Discord
catch (OperationCanceledException) { }
});

try
{
await _onConnecting().ConfigureAwait(false);
}
catch (TaskCanceledException ex)
{
Exception innerEx = ex.InnerException ?? new OperationCanceledException("Failed to connect.");
Error(innerEx);
throw innerEx;
}
await _onConnecting().ConfigureAwait(false);

await _logger.InfoAsync("Connected").ConfigureAwait(false);
State = ConnectionState.Connected;


+ 2
- 2
src/Discord.Net.WebSocket/DiscordSocketApiClient.cs View File

@@ -189,9 +189,9 @@ namespace Discord.API
catch { }

if (ex is GatewayReconnectException)
await WebSocketClient.DisconnectAsync(4000);
await WebSocketClient.DisconnectAsync(4000).ConfigureAwait(false);
else
await WebSocketClient.DisconnectAsync().ConfigureAwait(false);
await WebSocketClient.DisconnectAsync().ConfigureAwait(false);

ConnectionState = ConnectionState.Disconnected;
}


+ 11
- 4
src/Discord.Net.WebSocket/Net/DefaultWebSocketClient.cs View File

@@ -108,11 +108,11 @@ namespace Discord.Net.WebSockets
}
private async Task DisconnectInternalAsync(int closeCode = 1000, bool isDisposing = false)
{
_isDisconnecting = true;

try { _disconnectTokenSource.Cancel(false); }
catch { }

_isDisconnecting = true;

if (_client != null)
{
if (!isDisposing)
@@ -166,7 +166,14 @@ namespace Discord.Net.WebSockets

public async Task SendAsync(byte[] data, int index, int count, bool isText)
{
await _lock.WaitAsync().ConfigureAwait(false);
try
{
await _lock.WaitAsync(_cancelToken).ConfigureAwait(false);
}
catch (TaskCanceledException)
{
return;
}
try
{
if (_client == null) return;
@@ -201,7 +208,7 @@ namespace Discord.Net.WebSockets
{
while (!cancelToken.IsCancellationRequested)
{
WebSocketReceiveResult socketResult = await _client.ReceiveAsync(buffer, CancellationToken.None).ConfigureAwait(false);
WebSocketReceiveResult socketResult = await _client.ReceiveAsync(buffer, cancelToken).ConfigureAwait(false);
byte[] result;
int resultCount;



+ 16
- 16
src/Discord.Net/Discord.Net.nuspec View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Discord.Net</id>
<version>2.4.0$suffix$</version>
<version>2.4.1-dev$suffix$</version>
<title>Discord.Net</title>
<authors>Discord.Net Contributors</authors>
<owners>foxbot</owners>
@@ -14,25 +14,25 @@
<iconUrl>https://github.com/RogueException/Discord.Net/raw/dev/docs/marketing/logo/PackageLogo.png</iconUrl>
<dependencies>
<group targetFramework="net461">
<dependency id="Discord.Net.Core" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Rest" version="2.4.0$suffix$" />
<dependency id="Discord.Net.WebSocket" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Commands" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Webhook" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Core" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Rest" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.WebSocket" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Commands" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Webhook" version="2.4.1-dev$suffix$" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="Discord.Net.Core" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Rest" version="2.4.0$suffix$" />
<dependency id="Discord.Net.WebSocket" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Commands" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Webhook" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Core" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Rest" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.WebSocket" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Commands" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Webhook" version="2.4.1-dev$suffix$" />
</group>
<group targetFramework="netstandard2.1">
<dependency id="Discord.Net.Core" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Rest" version="2.4.0$suffix$" />
<dependency id="Discord.Net.WebSocket" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Commands" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Webhook" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Core" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Rest" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.WebSocket" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Commands" version="2.4.1-dev$suffix$" />
<dependency id="Discord.Net.Webhook" version="2.4.1-dev$suffix$" />
</group>
</dependencies>
</metadata>


Loading…
Cancel
Save