内容表

上一话题

PySide2.QtWebSockets

下一话题

QWebSocket

QMaskGenerator

QMaskGenerator class provides an abstract base for custom 32-bit mask generators. 更多

Inheritance diagram of PySide2.QtWebSockets.QMaskGenerator

详细描述

WebSockets 规范描述于 RFC 6455 要求屏蔽从客户端到服务器的所有通信。这是为阻止不良行为代理的恶意脚本攻击。有关良好屏蔽的重要性的更多信息,见 “Talking to Yourself for Fun and Profit” by Lin-Shung Huang et al 。默认情况下 QWebSocket 使用相当安全的 global() ->generate() function. The best measure against attacks mentioned in the document above, is to use QWebSocket 通过安全连接 ( wss:// )。通常,始终小心不要让第 3 方脚本访问 QWebSocket 在您的应用程序中。

class QMaskGenerator ( [ parent=None ] )
param parent

QObject

创建新 QMaskGenerator object with the given optional QObject parent .

PySide2.QtWebSockets.QMaskGenerator. nextMask ( )
返回类型

quint32

返回新的随机 32 位掩码。随机性取决于用于创建掩码的 RNG。

PySide2.QtWebSockets.QMaskGenerator. seed ( )
返回类型

bool

初始化 QMaskGenerator by seeding the randomizer. When is not called, it depends on the specific implementation of a subclass if a default seed is used or no seed is used at all. Returns true 若播种成功,否则 false。