Skip to content

Commit

Permalink
Mark PNSE-throwing methods in System.Net.NetworkInformation.IPGlobalP…
Browse files Browse the repository at this point in the history
…roperties as unsupported on Android (#50855)

Part of #47911.  

This is to annotate the following methods in System.Net.NetworkInformation.IPGlobalProperties as unsupported on Android since they throw PNSE:  

- GetActiveTcpConnections();
- GetActiveTcpListeners();
- GetActiveUdpListeners();
  • Loading branch information
MaximLipnin committed Apr 15, 2021
1 parent 516db73 commit 2590c6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ public abstract partial class IPGlobalProperties
public abstract System.Net.NetworkInformation.NetBiosNodeType NodeType { get; }
public virtual System.IAsyncResult BeginGetUnicastAddresses(System.AsyncCallback? callback, object? state) { throw null; }
public virtual System.Net.NetworkInformation.UnicastIPAddressInformationCollection EndGetUnicastAddresses(System.IAsyncResult asyncResult) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract System.Net.NetworkInformation.TcpConnectionInformation[] GetActiveTcpConnections();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract System.Net.IPEndPoint[] GetActiveTcpListeners();
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract System.Net.IPEndPoint[] GetActiveUdpListeners();
public abstract System.Net.NetworkInformation.IcmpV4Statistics GetIcmpV4Statistics();
public abstract System.Net.NetworkInformation.IcmpV6Statistics GetIcmpV6Statistics();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.Versioning;
using System.Threading.Tasks;

namespace System.Net.NetworkInformation
Expand All @@ -19,16 +20,19 @@ public static IPGlobalProperties GetIPGlobalProperties()
/// <summary>
/// Gets the Active Udp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract IPEndPoint[] GetActiveUdpListeners();

/// <summary>
/// Gets the Active Tcp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract IPEndPoint[] GetActiveTcpListeners();

/// <summary>
/// Gets the Active Udp Listeners on this machine.
/// </summary>
[UnsupportedOSPlatform("android")]
public abstract TcpConnectionInformation[] GetActiveTcpConnections();

/// <summary>
Expand Down

0 comments on commit 2590c6f

Please sign in to comment.