-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment with named pipes transport
- Loading branch information
Showing
36 changed files
with
1,739 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Servers/Connections.Abstractions/src/Features/IConnectionNamedPipeFeature.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.IO.Pipes; | ||
|
||
namespace Microsoft.AspNetCore.Connections.Features; | ||
|
||
/// <summary> | ||
/// Provides access to the connection's underlying <see cref="NamedPipeServerStream"/>. | ||
/// </summary> | ||
public interface IConnectionNamedPipeFeature | ||
{ | ||
/// <summary> | ||
/// Gets the underlying <see cref="NamedPipeServerStream"/>. | ||
/// </summary> | ||
NamedPipeServerStream NamedPipe { get; } | ||
} |
64 changes: 64 additions & 0 deletions
64
src/Servers/Connections.Abstractions/src/NamedPipeEndPoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
using System.Net; | ||
|
||
namespace Microsoft.AspNetCore.Connections; | ||
|
||
/// <summary> | ||
/// Represents a Named Pipe endpoint. | ||
/// </summary> | ||
public sealed class NamedPipeEndPoint : EndPoint | ||
{ | ||
internal const string LocalComputerServerName = "."; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="NamedPipeEndPoint"/> class. | ||
/// </summary> | ||
/// <param name="pipeName">The name of the pipe.</param> | ||
public NamedPipeEndPoint(string pipeName) : this(pipeName, LocalComputerServerName) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="NamedPipeEndPoint"/> class. | ||
/// </summary> | ||
/// <param name="pipeName">The name of the pipe.</param> | ||
/// <param name="serverName">The name of the remote computer to connect to, or "." to specify the local computer.</param> | ||
public NamedPipeEndPoint(string pipeName, string serverName) | ||
{ | ||
ServerName = serverName; | ||
PipeName = pipeName; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the name of the remote computer. The server name must be ".", the local computer, when creating a server. | ||
/// </summary> | ||
public string ServerName { get; } | ||
|
||
/// <summary> | ||
/// Gets the name of the pipe. | ||
/// </summary> | ||
public string PipeName { get; } | ||
|
||
/// <summary> | ||
/// Gets the pipe name represented by this <see cref="NamedPipeEndPoint"/> instance. | ||
/// </summary> | ||
public override string ToString() | ||
{ | ||
return $"pipe:{ServerName}/{PipeName}"; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override bool Equals([NotNullWhen(true)] object? obj) | ||
{ | ||
return obj is NamedPipeEndPoint other && other.ServerName == ServerName && other.PipeName == PipeName; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override int GetHashCode() | ||
{ | ||
return ServerName.GetHashCode() ^ PipeName.GetHashCode(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Servers/Connections.Abstractions/src/PublicAPI/net462/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#nullable enable | ||
Microsoft.AspNetCore.Connections.Features.IConnectionNamedPipeFeature | ||
Microsoft.AspNetCore.Connections.Features.IConnectionNamedPipeFeature.NamedPipe.get -> System.IO.Pipes.NamedPipeServerStream! | ||
Microsoft.AspNetCore.Connections.Features.IStreamClosedFeature | ||
Microsoft.AspNetCore.Connections.Features.IStreamClosedFeature.OnClosed(System.Action<object?>! callback, object? state) -> void | ||
Microsoft.AspNetCore.Connections.IConnectionListenerFactorySelector | ||
Microsoft.AspNetCore.Connections.IConnectionListenerFactorySelector.CanBind(System.Net.EndPoint! endpoint) -> bool | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.NamedPipeEndPoint(string! pipeName) -> void | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.NamedPipeEndPoint(string! pipeName, string! serverName) -> void | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.PipeName.get -> string! | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.ServerName.get -> string! | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.Equals(object? obj) -> bool | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.GetHashCode() -> int | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.ToString() -> string! |
10 changes: 10 additions & 0 deletions
10
src/Servers/Connections.Abstractions/src/PublicAPI/net7.0/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/Servers/Connections.Abstractions/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#nullable enable | ||
Microsoft.AspNetCore.Connections.Features.IConnectionNamedPipeFeature | ||
Microsoft.AspNetCore.Connections.Features.IConnectionNamedPipeFeature.NamedPipe.get -> System.IO.Pipes.NamedPipeServerStream! | ||
Microsoft.AspNetCore.Connections.Features.IStreamClosedFeature | ||
Microsoft.AspNetCore.Connections.Features.IStreamClosedFeature.OnClosed(System.Action<object?>! callback, object? state) -> void | ||
Microsoft.AspNetCore.Connections.IConnectionListenerFactorySelector | ||
Microsoft.AspNetCore.Connections.IConnectionListenerFactorySelector.CanBind(System.Net.EndPoint! endpoint) -> bool | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.NamedPipeEndPoint(string! pipeName) -> void | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.NamedPipeEndPoint(string! pipeName, string! serverName) -> void | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.PipeName.get -> string! | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.ServerName.get -> string! | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.Equals(object? obj) -> bool | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.GetHashCode() -> int | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.ToString() -> string! |
10 changes: 10 additions & 0 deletions
10
src/Servers/Connections.Abstractions/src/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
#nullable enable | ||
Microsoft.AspNetCore.Connections.Features.IConnectionNamedPipeFeature | ||
Microsoft.AspNetCore.Connections.Features.IConnectionNamedPipeFeature.NamedPipe.get -> System.IO.Pipes.NamedPipeServerStream! | ||
Microsoft.AspNetCore.Connections.Features.IStreamClosedFeature | ||
Microsoft.AspNetCore.Connections.Features.IStreamClosedFeature.OnClosed(System.Action<object?>! callback, object? state) -> void | ||
Microsoft.AspNetCore.Connections.IConnectionListenerFactorySelector | ||
Microsoft.AspNetCore.Connections.IConnectionListenerFactorySelector.CanBind(System.Net.EndPoint! endpoint) -> bool | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.NamedPipeEndPoint(string! pipeName) -> void | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.NamedPipeEndPoint(string! pipeName, string! serverName) -> void | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.PipeName.get -> string! | ||
Microsoft.AspNetCore.Connections.NamedPipeEndPoint.ServerName.get -> string! | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.Equals(object? obj) -> bool | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.GetHashCode() -> int | ||
override Microsoft.AspNetCore.Connections.NamedPipeEndPoint.ToString() -> string! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.