PythonQt.QtNetwork.QNetworkSession
QNetworkSession
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
A QNetworkSession enables control over the system's network interfaces. The session's configuration parameter are determined via the QNetworkConfiguration object to which it is bound. Depending on the type of the session (single access point or service network) a session may be linked to one or more network interfaces. By means of opening and closing of network sessions a developer can start and stop the systems network interfaces. If the configuration represents multiple access points (see QNetworkConfiguration::ServiceNetwork) more advanced features such as roaming may be supported.
QNetworkSession supports session management within the same process and depending on the platform's capabilities may support out-of-process sessions. If the same network configuration is used by multiple open sessions the underlying network interface is only terminated once the last session has been closed.
Roaming
Applications may connect to the preferredConfigurationChanged() signal in order to receive notifications when a more suitable access point becomes available. In response to this signal the application must either initiate the roaming via migrate() or ignore() the new access point. Once the session has roamed the newConfigurationActivated() signal is emitted. The application may now test the carrier and must either accept() or reject() it. The session will return to the previous access point if the roaming was rejected. The subsequent state diagram depicts the required state transitions.

Some platforms may distinguish forced roaming and application level roaming (ALR). ALR implies that the application controls (via migrate(), ignore(), accept() and reject()) whether a network session can roam from one access point to the next. Such control is useful if the application maintains stateful socket connections and wants to control the transition from one interface to the next. Forced roaming implies that the system automatically roams to the next network without consulting the application. This has the advantage that the application can make use of roaming features without actually being aware of it. It is expected that the application detects that the underlying socket is broken and automatically reconnects via the new network link.
If the platform supports both modes of roaming, an application indicates its preference by connecting to the preferredConfigurationChanged() signal. Connecting to this signal means that the application wants to take control over the roaming behavior and therefore implies application level roaming. If the client does not connect to the preferredConfigurationChanged(), forced roaming is used. If forced roaming is not supported the network session will not roam by default.
Some applications may want to suppress any form of roaming altogether. Possible use cases may be high priority downloads or remote services which cannot handle a roaming enabled client. Clients can suppress roaming by connecting to the preferredConfigurationChanged() signal and answer each signal emission with ignore().
Source: https://doc.qt.io/archives/qt-5.15/qnetworksession.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
Closing |
attribute | Any |
|
Connected |
attribute | Any |
|
Connecting |
attribute | Any |
|
Disconnected |
attribute | Any |
|
Invalid |
attribute | Any |
(shared captured text) |
InvalidConfigurationError |
attribute | Any |
|
NoBackgroundTrafficPolicy |
attribute | Any |
|
NoPolicy |
attribute | Any |
|
NotAvailable |
attribute | Any |
|
OperationNotSupportedError |
attribute | Any |
|
Roaming |
attribute | Any |
|
RoamingError |
attribute | Any |
|
SessionAbortedError |
attribute | Any |
|
SessionError |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
State |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
UnknownSessionError |
attribute | Any |
|
UsagePolicies |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
UsagePolicy |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
accept |
function | (self) -> None |
Instructs the session to permanently accept the new access point. |
activeTime |
function | (self) -> int |
X.activeTime() -> int |
blockSignals |
function | (self, b: Any) -> bool |
X.blockSignals(b) -> bool (shared captured text) |
bytesReceived |
function | (self) -> int |
X.bytesReceived() -> int |
bytesWritten |
function | (self) -> int |
X.bytesWritten() -> int |
childEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
children |
function | (self) -> tuple |
X.children() -> tuple (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
close |
function | (self) -> None |
Decreases the session counter on the associated network configuration. |
closed |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.closed; argument details are not documented. |
configuration |
function | (self) -> Any |
X.configuration() -> PythonQt.QtNetwork.QNetworkConfiguration |
connect |
function | (self, signal: Any, receiver: Any, slot: Any, type: Any) -> bool |
X.connect(signal, receiver, slot, type) -> bool (shared captured text) |
connectNotify |
function | (self, signal: Any) -> None |
|
customEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
deleteLater |
function | (self) -> Any |
(shared captured text) |
destroyed |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.destroyed; argument details are not documented. |
disconnect |
function | (self, signal: Any, receiver: Any, slot: Any) -> bool |
X.disconnect(signal, receiver, slot) -> bool (shared captured text) |
disconnectNotify |
function | (self, signal: Any) -> None |
|
dumpObjectInfo |
function | (self) -> Any |
(shared captured text) |
dumpObjectTree |
function | (self) -> Any |
(shared captured text) |
dynamicPropertyNames |
function | (self) -> Any |
(shared captured text) |
error |
function | (self) -> Any |
This signal is emitted after an error occurred. |
errorString |
function | (self) -> str |
X.errorString() -> str |
event |
function | (self, event: Any) -> bool |
X.event(event) -> bool (shared captured text) |
eventFilter |
function | (self, watched: Any, event: Any) -> bool |
X.eventFilter(watched, event) -> bool (shared captured text) |
findChild |
function | (self, type: Any, name: Any) -> Any |
X.findChild(type, name) -> PythonQt.private.QObject (shared captured text) |
findChildren |
function | (self, type: Any, name: Any) -> tuple |
X.findChildren(type, name) -> tuple (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
ignore |
function | (self) -> None |
This function indicates that the application does not wish to roam the session. |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
installEventFilter |
function | (self, filterObj: Any) -> Any |
(shared captured text) |
interface |
function | (self) -> Any |
X.interface() -> PythonQt.QtNetwork.QNetworkInterface |
isOpen |
function | (self) -> bool |
X.isOpen() -> bool |
isSignalConnected |
function | (self, signal: Any) -> bool |
X.isSignalConnected(signal) -> bool (shared captured text) |
isWidgetType |
function | (self) -> bool |
X.isWidgetType() -> bool (shared captured text) |
isWindowType |
function | (self) -> bool |
X.isWindowType() -> bool (shared captured text) |
killTimer |
function | (self, id: Any) -> Any |
(shared captured text) |
metaObject |
function | (self) -> Any |
X.metaObject() -> PythonQt.QtCore.QMetaObject (shared captured text) |
migrate |
function | (self) -> None |
Instructs the session to roam to the new access point. |
moveToThread |
function | (self, thread: Any) -> Any |
(shared captured text) |
newConfigurationActivated |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.newConfigurationActivated; argument details are not documented. |
objectName |
attribute | Any |
(shared captured text) |
objectNameChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.objectNameChanged; argument details are not documented. |
open |
function | (self) -> None |
Creates an open session which increases the session counter on the underlying network interface. |
opened |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.opened; argument details are not documented. |
parent |
function | (self) -> Any |
X.parent() -> PythonQt.private.QObject (shared captured text) |
preferredConfigurationChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.preferredConfigurationChanged; argument details are not documented. |
property |
function | (self, name: Any) -> Any |
X.property(name) -> object (shared captured text) |
reject |
function | (self) -> None |
The new access point is not suitable for the application. |
removeEventFilter |
function | (self, obj: Any) -> Any |
(shared captured text) |
sender |
function | (self) -> Any |
X.sender() -> PythonQt.private.QObject (shared captured text) |
senderSignalIndex |
function | (self) -> int |
X.senderSignalIndex() -> int (shared captured text) |
sessionProperty |
function | (self, key: str) -> Any |
X.sessionProperty(key) -> object |
setObjectName |
function | (self, name: Any) -> Any |
(shared captured text) |
setParent |
function | (self, parent: Any) -> Any |
(shared captured text) |
setProperty |
function | (self, name: Any, value: Any) -> bool |
X.setProperty(name, value) -> bool (shared captured text) |
setSessionProperty |
function | (self, key: str, value: Any) -> None |
X.setSessionProperty(key, value) |
signalsBlocked |
function | (self) -> bool |
X.signalsBlocked() -> bool (shared captured text) |
startTimer |
function | (self, interval: Any, timerType: Any) -> int |
X.startTimer(interval, timerType) -> int (shared captured text) |
state |
function | (self) -> Any |
Returns the state of the session. |
stateChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.stateChanged; argument details are not documented. |
stop |
function | (self) -> None |
Invalidates all open sessions against the network interface and therefore stops the underlying network interface. |
thread |
function | (self) -> Any |
(shared captured text) |
timerEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
tr |
function | (self, text: Any, ambig: Any, n: Any) -> str |
X.tr(text, ambig, n) -> str (shared captured text) |
usagePolicies |
function | (self) -> Any |
Returns the network usage policies currently in force by the system. |
usagePoliciesChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.QtNetwork.QNetworkSession.usagePoliciesChanged; argument details are not documented. |
waitForOpened |
function | (self, msecs: int) -> bool |
X.waitForOpened(msecs) -> bool |