-
Notifications
You must be signed in to change notification settings - Fork 383
Extend diagnostics to handle tcpip diagnostics client option #2833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#if DIAGNOSTICS_RUNTIME | ||
// As of https://github.com/dotnet/runtime/pull/64358, InternalsVisibleTo MSBuild Item does not seem to work in Dotnet/Runtime like it does on Dotnet/Diagnostics | ||
using System; | ||
using System.IO; | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("common")] | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Diagnostics; | ||
|
@@ -23,6 +22,8 @@ public IpcSocket(AddressFamily addressFamily, SocketType socketType, ProtocolTyp | |
{ | ||
} | ||
|
||
// .NET 6 implements this method directly on Socket, but for earlier runtimes we need a polyfill | ||
#if !NET6_0 | ||
public async Task<Socket> AcceptAsync(CancellationToken token) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI - this override will always be used at runtime given our compilation modes, regardless of the runtime version that gets used. |
||
{ | ||
using (token.Register(() => Close(0))) | ||
|
@@ -44,6 +45,7 @@ public async Task<Socket> AcceptAsync(CancellationToken token) | |
} | ||
} | ||
} | ||
#endif | ||
|
||
public virtual void Connect(EndPoint remoteEP, TimeSpan timeout) | ||
{ | ||
|
@@ -60,6 +62,8 @@ public virtual void Connect(EndPoint remoteEP, TimeSpan timeout) | |
} | ||
} | ||
|
||
// .NET 6 implements this method directly on Socket, but for earlier runtimes we need a polyfill | ||
#if !NET6_0 | ||
public async Task ConnectAsync(EndPoint remoteEP, CancellationToken token) | ||
{ | ||
using (token.Register(() => Close(0))) | ||
|
@@ -82,6 +86,6 @@ public async Task ConnectAsync(EndPoint remoteEP, CancellationToken token) | |
} | ||
} | ||
} | ||
|
||
#endif | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,11 @@ | |
<IsShipping>true</IsShipping> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(GitHubRepositoryName)' == 'runtime'"> | ||
<DefineConstants>$(DefineConstants);DIAGNOSTICS_RUNTIME</DefineConstants> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to define NET_6 here, or does that happen somewhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NET_6 should be defined iff compiling against net6.0+ TFMs. |
||
<NoWarn>CS1591,CS8073,CS0162</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="$(MicrosoftBclAsyncInterfacesVersion)" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingVersion)" /> | ||
|
@@ -29,4 +34,8 @@ | |
<InternalsVisibleTo Include="Microsoft.Diagnostics.Monitoring.WebApi" /> | ||
<InternalsVisibleTo Include="Microsoft.Diagnostics.NETCore.Client.UnitTests" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Condition="'$(GitHubRepositoryName)' == 'runtime'" Include="**/*.cs" /> | ||
</ItemGroup> | ||
</Project> |
Uh oh!
There was an error while loading. Please reload this page.