refactor(historian): remove named-pipe transport
This commit is contained in:
+2
-19
@@ -1,4 +1,3 @@
|
||||
using System.IO.Pipes;
|
||||
using System.Net.Security;
|
||||
using System.Net.Sockets;
|
||||
using System.Security.Authentication;
|
||||
@@ -31,22 +30,6 @@ internal sealed class FrameChannel : IAsyncDisposable
|
||||
private FrameWriter? _writer;
|
||||
private bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Default factory: connects to a real <see cref="NamedPipeClientStream"/> by name.
|
||||
/// </summary>
|
||||
public static Func<WonderwareHistorianClientOptions, CancellationToken, Task<Stream>> DefaultNamedPipeConnectFactory =
|
||||
async (opts, ct) =>
|
||||
{
|
||||
var pipe = new NamedPipeClientStream(
|
||||
serverName: ".",
|
||||
pipeName: opts.PipeName,
|
||||
direction: PipeDirection.InOut,
|
||||
options: PipeOptions.Asynchronous);
|
||||
|
||||
await pipe.ConnectAsync((int)opts.EffectiveConnectTimeout.TotalMilliseconds, ct).ConfigureAwait(false);
|
||||
return pipe;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Default TCP factory: connects to the sidecar over TCP, optionally wrapping the stream
|
||||
/// in TLS (server-auth; pinned-thumbprint or CA-chain validation). The Hello handshake +
|
||||
@@ -63,7 +46,7 @@ internal sealed class FrameChannel : IAsyncDisposable
|
||||
{
|
||||
using var connectCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
|
||||
connectCts.CancelAfter(opts.EffectiveConnectTimeout);
|
||||
await tcp.ConnectAsync(opts.Host!, opts.Port, connectCts.Token).ConfigureAwait(false);
|
||||
await tcp.ConnectAsync(opts.Host, opts.Port, connectCts.Token).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -85,7 +68,7 @@ internal sealed class FrameChannel : IAsyncDisposable
|
||||
});
|
||||
try
|
||||
{
|
||||
await ssl.AuthenticateAsClientAsync(opts.Host!).ConfigureAwait(false);
|
||||
await ssl.AuthenticateAsClientAsync(opts.Host).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user