-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kestrel named pipes transport (#44426)
- Loading branch information
Showing
40 changed files
with
1,897 additions
and
39 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#nullable enable | ||
*REMOVED*Microsoft.AspNetCore.Http.StreamResponseBodyFeature.StreamResponseBodyFeature(System.IO.Stream! stream, Microsoft.AspNetCore.Http.Features.IHttpResponseBodyFeature! priorFeature) -> void | ||
Microsoft.AspNetCore.Http.BindingAddress.IsNamedPipe.get -> bool | ||
Microsoft.AspNetCore.Http.BindingAddress.NamedPipeName.get -> string! | ||
Microsoft.AspNetCore.Http.StreamResponseBodyFeature.StreamResponseBodyFeature(System.IO.Stream! stream, Microsoft.AspNetCore.Http.Features.IHttpResponseBodyFeature? priorFeature) -> void |
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; } | ||
} |
65 changes: 65 additions & 0 deletions
65
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,65 @@ | ||
// 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() | ||
{ | ||
// Based on format at https://learn.microsoft.com/windows/win32/ipc/pipe-names | ||
return $@"\\{ServerName}\pipe\{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/net8.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! |
Oops, something went wrong.