Skip to content

Commit

Permalink
Merge pull request #741 from dotnet/fix740
Browse files Browse the repository at this point in the history
Add .NET 6 target
  • Loading branch information
AArnott authored Apr 17, 2024
2 parents a6122a8 + 01dc37f commit 5a1f3e0
Show file tree
Hide file tree
Showing 6 changed files with 313 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Nerdbank.Streams/FullDuplexStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati

public override void WriteByte(byte value) => this.writableStream.WriteByte(value);

public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
=> this.readableStream.BeginRead(buffer, offset, count, callback, state);

public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback? callback, object? state)
=> this.writableStream.BeginWrite(buffer, offset, count, callback, state);

public override int EndRead(IAsyncResult asyncResult) => this.readableStream.EndRead(asyncResult);
Expand Down
2 changes: 1 addition & 1 deletion src/Nerdbank.Streams/MultiplexingStream.Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ internal void Dispose(Exception? disposeException)
{
try
{
Channel self = (Channel)state;
Channel self = (Channel)state!;
PipeWriter? mxStreamIOWriter;
lock (self.SyncObject)
Expand Down
4 changes: 2 additions & 2 deletions src/Nerdbank.Streams/Nerdbank.Streams.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<DefineConstants>$(DefineConstants);MESSAGEPACK_INTERNAL;CSHARP8</DefineConstants>

<Summary>Streams for full duplex in-proc communication, wrap a WebSocket, split a stream into multiple channels, etc.</Summary>
Expand All @@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Validation" />
<PackageReference Include="System.IO.Pipelines" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Condition="'$(TargetFramework)' != 'net6.0'" />
</ItemGroup>
<ItemGroup>
<Compile Update="Strings.Designer.cs">
Expand Down
2 changes: 1 addition & 1 deletion src/Nerdbank.Streams/Substream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public override long Position

/// <inheritdoc/>
public
#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
new // https://github.com/dotnet/csharplang/issues/3613: There's no way to *override* the base method without a binary breaking change from changing the return type on this method.
#endif
Task DisposeAsync() => this.DisposeAsync(CancellationToken.None).AsTask();
Expand Down
Loading

0 comments on commit 5a1f3e0

Please sign in to comment.