系统之家提供 Windows 系统、Ghost 系统、驱动与常用软件的安全下载及安装教程。 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

ControlChannelTrigger Class (Windows.Networking.Sockets)

发布时间:2026-08-14 | 浏览:1
📥 下载地址(文章开头)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等
访问此页面需要授权。 可以尝试 登录 或 更改目录 。 访问此页面需要授权。 可以尝试 更改目录 。 Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here. Enables real time notifications to be received in the background for objects that establish a TCP connection and wish to be notified of incoming traffic. Call **BackgroundExecutionManager.RequestAccessAsync** before using ControlChannelTrigger . Windows requirements The ControlChannelTrigger class and related interfaces are used to enable your app to use the network when your app is not the foreground app. A Universal Windows app is normally suspended when it is no longer in the foreground app and moved to the background. There are some exceptions to suspending an app (actively printing, accessing an audio stream, and transferring files in the background, for example). The ControlChannelTrigger class allows a network app that has established a TCP connection to notify the system that an established network connection should be kept operational and the system should wake up the suspended app when network data is received for the app or the server keep-alive timer interval expires. Use control channel triggers when your app needs to maintain a network connection even if it is in the background. While the ControlChannelTrigger class can be used with DatagramSocket , StreamSocket , or StreamSocketListener , Windows 10 provides an improved mechanism for apps that use those classes and want to maintain connections while in the background. See Network communications in the background for details about SocketActivityTrigger and the socket broker. The ControlChannelTrigger class is recommended to be used by instances of the following that establish a TCP connection: The HttpClient class in the Windows.Web.Http namespace. The HttpClient and HttpClientHandler classes in the System.Net.Http namespace in the .NET Framework. Custom classes that derive from these classes are also supported. The IXMLHTTPRequest2 interface. The IXMLHTTPRequest2 interface is an extension to XMLHttpRequest object defined in several working drafts published by the World Wide Web Consortium (W3C) There are several types of keep-alive intervals that may relate to network apps. At the lowest level, an app can set a TCP keep-alive option to send TCP keep-alive packets between a client app and a server to maintain an established TCP connection that is not being used. The HttpClient class and the XMLHttpRequest JavaScript object do not have an option to enable TCP keep-alive and this option is disabled by default. The TCP keep-alive must be disabled in order to use the ControlChannelTrigger class to support background network notifications. In the context of the ControlChannelTrigger class, there are two other keep-alive intervals that have an impact. Server keep-alive interval - This refers to a keep-alive interval in minutes that the app registers with the system for how often to be woken up when the app has been suspended. The system will wake up the app based on the value set for this keep-alive interval. This value is represented by the ServerKeepAliveIntervalInMinutes property on a ControlChannelTrigger class and is set as an argument to the ControlChannelTrigger constructor. This value is considered a server keep-alive interval since a network app might normally set this based on known behavior of the server to which the app has established a TCP connection. For example, if it is known that a web server will disconnect and drop TCP connections if there is no data sent by the app for 30 minutes, the network app could set this server keep-alive interval to 25 minutes. Network keep-alive interval - This refers to an internal keep-alive timer maintained by low-level network components in the TCP stack based on current network conditions. This value represents the value needed by network intermediaries to keep the TCP connection intact. These network intermediaries represent hardware and devices such as network proxies and network address translators. A network app cannot set this value, since this value is determined dynamically by low-level system components in the TCP stack. The internal calculation of the network keep-alive interval does take account of the server keep-alive interval. A network app can indicate to the system that the network keep-alive timer should be decreased if established TCP connections are regularly dropped by calling the DecreaseNetworkKeepAliveInterval method on a ControlChannelTrigger class. Version history Creates a new ControlChannelTrigger object with a control channel trigger ID, a value for the server keep-alive interval, and the resource type requested for the control channel trigger. Creates a new ControlChannelTrigger object with a control channel trigger ID and a value for the server keep-alive interval. Gets a string that can be used to differentiate various control channel triggers on the local computer. Gets the network keep-alive interval, in minutes, maintained by low-level network components in the TCP stack based on current network conditions.
📥 下载地址(文章中间)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等
Gets a value indicating whether waking from low power states is supported. Gets an object that represents the keep-alive trigger associated with the ControlChannelTrigger object that an app should use to bind the activation class with the background broker infrastructure. Gets an object that represents the push notification trigger associated with the ControlChannelTrigger object that an app should use to bind the activation class with the background broker infrastructure. Get or set the server keep-alive interval, in minutes, registered with the system to indicate when the app and associated network connections used should wake up. Gets the transport object that the system is using for the transport connection associated with the ControlChannelTrigger object. Closes the ControlChannelTrigger object. Provides a way for an app to indicate that the network keep-alive interval maintained by the system with network intermediaries to wake up was too long and should be decreased. This method applies to class elements in the Windows.Networking.Sockets and related namespaces. Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Flushes any networking data used by the transport connection associated with the ControlChannelTrigger to the networking stack. Sets the transport connection to be used by a control channel trigger by class elements in the Windows.Networking.Sockets and related namespaces. Allows an app to notify the system that a connection has been established and the system should complete the internal configuration of the control channel trigger. SocketActivityTrigger Windows.Web.Http Networking basics Network communications in the background IXMLHTTPRequest2 System.Net.Http System.Net.Http.HttpClient System.Net.Http.HttpClientHandler Background task sample 想要尝试使用 Ask Learn 阐明或指导你完成本主题?
📥 下载地址(文章结尾)
装机神器,可安装一切系统,纯净版,英文版,繁体版 ,精简版,原版等等等