Skip to content

Commit

Permalink
refactor: Removed unused .Net standard PipeStreamWriter.WaitForPipeDr…
Browse files Browse the repository at this point in the history
…ain method.
  • Loading branch information
HavenDV committed Apr 21, 2022
1 parent 34aee61 commit 968327e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/libs/H.Pipes/IO/PipeStreamWriter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.IO.Pipes;
using System.IO.Pipes;
using System.Net;

namespace H.Pipes.IO;
Expand Down Expand Up @@ -83,18 +83,24 @@ public async Task WriteAsync(byte[] buffer, CancellationToken cancellationToken
}
}

#if NET461_OR_GREATER
/// <summary>
/// Waits for the other end of the pipe to read all sent bytes.
/// </summary>
/// <exception cref="ObjectDisposedException">The pipe is closed.</exception>
/// <exception cref="NotSupportedException">The pipe does not support write operations.</exception>
/// <exception cref="IOException">The pipe is broken or another I/O error occurred.</exception>
#if NET461_OR_GREATER
public void WaitForPipeDrain()
{
BaseStream.WaitForPipeDrain();
}
#elif NET5_0_OR_GREATER
/// <summary>
/// Waits for the other end of the pipe to read all sent bytes.
/// </summary>
/// <exception cref="ObjectDisposedException">The pipe is closed.</exception>
/// <exception cref="NotSupportedException">The pipe does not support write operations.</exception>
/// <exception cref="IOException">The pipe is broken or another I/O error occurred.</exception>
public void WaitForPipeDrain()
{
if (OperatingSystem.IsWindows())
Expand All @@ -103,11 +109,6 @@ public void WaitForPipeDrain()
}
}
#elif NETSTANDARD2_0_OR_GREATER
private static void WaitForPipeDrain()
{
// Empty because it is only supported for Windows platforms.
// There are explicit implementations for this for .Net Framework 4.6.1/.Net 5/.Net 6
}
#else
#error Target Framework is not supported
#endif
Expand Down

0 comments on commit 968327e

Please sign in to comment.