Provides miscellaneous tools for interacting with a network. More...
Import Statement: | import ArcGIS.AppFramework.Networking 1.0 |
Properties
- activeConfiguration : NetworkConfiguration
- addresses : List<NetworkAddress>
- anyAddress : string
- anyIPv4Address : string
- anyIPv6Address : string
- broadcastAddress : string
- configurations : List<NetworkConfiguration>
- credentialSignalingObject : CredentialSignalingInternal
- defaultUserAgent : string
- domainName : string
- hostName : string
- ignoreSslErrors : bool
- interfaces : List<NetworkInterface>
- isOnline : bool
- localHostAddress : string
- localHostIPv6Address : string
- networkAccessible : NetworkAccessibility
- nullAddress : string
- password : string
- pkcs12 : object
- proxyPassword : string
- proxyRealm : string
- proxyUser : string
- realm : string
- strictTransportSecurityEnabled : bool
- systemCaCertificates : QStringList
- timeout : int
- user : string
Signals
- authenticationChallenge(AuthenticationChallenge authChallenge)
- networkChanged()
- networkError(url url, int error, string errorString)
- sslErrors(url url, object errors)
Methods
- bool addDefaultCaCertificates(string path)
- bool addDefaultCaCertificates(string path, encodingformat format)
- bool addDefaultCaCertificates(string path, encodingformat format, patternsyntax patternSyntax)
- clearAccessCache()
- clearConnectionCache()
- object importPkcs12(object pkcs12File, string passPhrase)
- bool isSpecialAddress(var address)
- updateConfigurations()
Detailed Description
The Networking component handles miscellaneous properties used to identify details of the network the device is currently connected to. This component contains no means to interact with or write to these components, and is only capable of displaying them.
This code sample demonstrates using the Networking component to return some basic information about the network the device is currently connected to. The online status of the network connection will be displayed as a checkbox, but may not be writable by the app.
ColumnLayout { anchors { fill: parent margins: 5 * AppFramework.displayScaleFactor } CheckBox { enabled: false checked: AppFramework.network.isOnline text: "Online" } Text { Layout.fillWidth: true text: "Host name: %1".arg(Networking.hostName) } Text { Layout.fillWidth: true text: "Domain name: %1".arg(Networking.domainName) } Text { text: "Active configuration: %1 %2".arg(Networking.activeConfiguration.bearerTypeName).arg(Networking.activeConfiguration.name) } }
Enumerations
NetworkAccessibility enumeration
Name | Value |
---|---|
Networking.NetworkAccessibilityUnknownAccessibility | -1 |
Networking.NetworkAccessibilityNotAccessible | 0 |
Networking.NetworkAccessibilityAccessible | 1 |
EncodingFormat enumeration
Name | Value |
---|---|
Networking.EncodingFormatPem | 0 |
Networking.EncodingFormatDer | 1 |
PatternSyntax enumeration
Name | Value |
---|---|
Networking.PatternSyntaxRegExp | 0 |
Networking.PatternSyntaxWildcard | 1 |
Networking.PatternSyntaxFixedString | 2 |
Networking.PatternSyntaxRegExp2 | 3 |
Networking.PatternSyntaxWildcardUnix | 4 |
Networking.PatternSyntaxW3CXmlSchema11 | 5 |
Property Documentation
[read-only] activeConfiguration : NetworkConfiguration |
Returns the current active network configuration.
[read-only] addresses : List<NetworkAddress> |
Returns a list of IP addresses currently being tracked by NetworkAddress.
Returns the dual stack any-address. A socket bound on this address will listen on both IPv4 and IPv6 interfaces.
Reutrns the IPv4 any-address. A socket bound with this address will listen only on IPv4 interfaces.
Returns the IPv6 any-address. A socket bound with this address will listen only on IPv6 devices.
[read-only] configurations : List<NetworkConfiguration> |
Returns a list of configurations currently being tracked by NetworkConfiguration.
[read-only] interfaces : List<NetworkInterface> |
Returns a list of interfaces being tracked by NetworkInterface.
Holds whether the network is currently accessible. Uses the NetworkAccessibility enum.
Read, set or clear the current PKCS#12 credentials object.
When you set a PKCS#12 credentials object, all subsequent SSL requests will use the new credentials. Use the clearAccessCache method to pick up changes to the PKCS#12 credential object, as otherwise requests may use the previous credentials.
Returns true if HTTP Strict Transport Security (HSTS) is enabled, otherwise returns false. By default, this is disabled.
Signal Documentation
authenticationChallenge(AuthenticationChallenge authChallenge) |
Note: The corresponding handler is onAuthenticationChallenge
.
Signal emitted when the state of the network has changed.
Note: The corresponding handler is onNetworkChanged
.
Note: The corresponding handler is onNetworkError
.
Method Documentation
The path parameter
The format parameter
The path parameter
The format parameter
The patternSyntax parameter
Flushes the internal cache of network connections. In contrast to the clearAccessCache method, the authentication data is preserved.
Imports a PKCS#12 from a file, resource, or a binary object. The PKCS#12 file is a bundle containing a private key, certificates, and any associated caCertificates. If the passPhrase parameter is specified then it will be used to decrypt the PKCS#12 bundle.
If successful, this method returns the decrypted bundle as a PKCS#12 credential object. Otherwise, this method returns an empty response.
The pkcs12File parameter
Specifies a PKCS#12 (.pfx or .p12) file, resource, or binary object.
The passPhrase parameter
A password to decrypt the bundle.
Returns true if the given address is a special address. Otherwise, returns false.
Potential special addresses are Null, LocalHost, LocalHostIPv6, Broadcast, AnyIPv4, AnyIPv6, and Any.
The address parameter
The address to check.
Initiates an update of all configurations. This may be used to initiate WLAN scans or other time-consuming updates which may be required to obtain the correct state for configurations.