Skip to content

Commit 499699c

Browse files
authored
Updating C# code
1 parent 861ae27 commit 499699c

File tree

1 file changed

+16
-48
lines changed

1 file changed

+16
-48
lines changed

specs/WebRtcPortConfiguration.md

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -128,54 +128,22 @@ interface ICoreWebView2StagingEnvironmentOptions10 : IUnknown {
128128

129129
### C#
130130
```csharp
131-
/// <summary>
132-
/// Specifies the network protocol type for port configuration.
133-
/// </summary>
134-
public enum COREWEBVIEW2_NETWORK_PROTOCOL
135-
{
136-
/// <summary>
137-
/// Transmission Control Protocol - reliable, connection-oriented protocol.
138-
/// </summary>
139-
COREWEBVIEW2_NETWORK_PROTOCOL_TCP,
140-
/// <summary>
141-
/// User Datagram Protocol - fast, connectionless protocol.
142-
/// </summary>
143-
COREWEBVIEW2_NETWORK_PROTOCOL_UDP,
144-
}
145-
146-
/// <summary>
147-
/// Additional options used to create WebView2 Environment to manage port range configuration.
148-
/// </summary>
149-
public interface ICoreWebView2StagingEnvironmentOptions10
131+
namespace Microsoft.Web.WebView2.Core
150132
{
151-
/// <summary>
152-
/// Sets the allowed port range for the specified network protocol.
153-
/// This allows WebView2 to work within enterprise firewall constraints
154-
/// by restricting network communication to the specified port range.
155-
/// Currently WebRTC UDP port restriction is supported.
156-
/// </summary>
157-
/// <param name="protocol">The network protocol (TCP or UDP) for which to set the port range.</param>
158-
/// <param name="minPort">The minimum port number in the allowed range (inclusive).</param>
159-
/// <param name="maxPort">The maximum port number in the allowed range (inclusive).</param>
160-
void SetAllowedPortRange(
161-
COREWEBVIEW2_NETWORK_PROTOCOL protocol,
162-
int minPort,
163-
int maxPort
164-
);
165-
166-
/// <summary>
167-
/// Gets the allowed port range for the specified network protocol.
168-
/// Returns the current port range configuration that was set via
169-
/// SetAllowedPortRange. Default value is 0,0, which means no restrictions applied
170-
/// and ports are allocated randomly between system's ephemeral range.
171-
/// </summary>
172-
/// <param name="protocol">The network protocol (TCP or UDP) for which to get the port range.</param>
173-
/// <param name="minPort">Receives the minimum port number in the allowed range.</param>
174-
/// <param name="maxPort">Receives the maximum port number in the allowed range.</param>
175-
void GetAllowedPortRange(
176-
COREWEBVIEW2_NETWORK_PROTOCOL protocol,
177-
out int minPort,
178-
out int maxPort
179-
);
133+
enum CoreWebView2NetworkProtocol
134+
{
135+
Tcp = 0,
136+
Udp = 1,
137+
};
138+
139+
runtimeclass CoreWebView2EnvironmentOptions
140+
{
141+
[interface_name("Microsoft.Web.WebView2.Core.ICoreWebView2StagingEnvironmentOptions10")]
142+
{
143+
// ICoreWebView2StagingEnvironmentOptions10 members
144+
void SetAllowedPortRange(CoreWebView2NetworkProtocol protocol, Int32 minPort, Int32 maxPort);
145+
void GetAllowedPortRange(CoreWebView2NetworkProtocol protocol, out Int32 minPort, out Int32 maxPort);
146+
}
147+
}
180148
}
181149
```

0 commit comments

Comments
 (0)