-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-kestrelhelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issueseverity-nice-to-haveThis label is used by an internal toolThis label is used by an internal tool
Milestone
Description
Is your feature request related to a problem? Please describe.
We should make it so you don't have to resort to something like the following to access the managed Socket if you really want to.
var socket = (Socket)connectionContext.GetType().GetField("_socket", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(connectionContext);Proposed API
using System.Net.Sockets;
namespace Microsoft.AspNetCore.Connections.Features
{
+ public interface IConnectionSocketFeature
+ {
+ Socket? Socket { get; }
+ }
}Usage Examples
var socket = connectionContext.Features.Get<IConnectionSocketFeature>().Socket;davidfowl and gfoidl
Metadata
Metadata
Assignees
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-kestrelhelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issueseverity-nice-to-haveThis label is used by an internal toolThis label is used by an internal tool