qwebsocketserver.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // qwebsocketserver.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWebSockets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %If (Qt_6_2_0 -)
  22. class QWebSocketServer : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qwebsocketserver.h>
  26. %End
  27. public:
  28. enum SslMode
  29. {
  30. %If (PyQt_SSL)
  31. SecureMode,
  32. %End
  33. NonSecureMode,
  34. };
  35. QWebSocketServer(const QString &serverName, QWebSocketServer::SslMode secureMode, QObject *parent /TransferThis/ = 0);
  36. virtual ~QWebSocketServer();
  37. bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
  38. void close();
  39. bool isListening() const;
  40. void setMaxPendingConnections(int numConnections);
  41. int maxPendingConnections() const;
  42. quint16 serverPort() const;
  43. QHostAddress serverAddress() const;
  44. QWebSocketServer::SslMode secureMode() const;
  45. bool setSocketDescriptor(qintptr socketDescriptor);
  46. qintptr socketDescriptor() const;
  47. bool hasPendingConnections() const;
  48. virtual QWebSocket *nextPendingConnection() /Factory/;
  49. QWebSocketProtocol::CloseCode error() const;
  50. QString errorString() const;
  51. void pauseAccepting();
  52. void resumeAccepting();
  53. void setServerName(const QString &serverName);
  54. QString serverName() const;
  55. void setProxy(const QNetworkProxy &networkProxy);
  56. QNetworkProxy proxy() const;
  57. %If (PyQt_SSL)
  58. void setSslConfiguration(const QSslConfiguration &sslConfiguration);
  59. %End
  60. %If (PyQt_SSL)
  61. QSslConfiguration sslConfiguration() const;
  62. %End
  63. QList<QWebSocketProtocol::Version> supportedVersions() const;
  64. QUrl serverUrl() const;
  65. void handleConnection(QTcpSocket *socket) const;
  66. signals:
  67. void acceptError(QAbstractSocket::SocketError socketError);
  68. void serverError(QWebSocketProtocol::CloseCode closeCode);
  69. void originAuthenticationRequired(QWebSocketCorsAuthenticator *pAuthenticator);
  70. void newConnection();
  71. %If (PyQt_SSL)
  72. void peerVerifyError(const QSslError &error);
  73. %End
  74. %If (PyQt_SSL)
  75. void sslErrors(const QList<QSslError> &errors);
  76. %End
  77. void closed();
  78. %If (PyQt_SSL)
  79. void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
  80. %End
  81. public:
  82. void setHandshakeTimeout(int msec);
  83. int handshakeTimeoutMS() const;
  84. %If (Qt_6_4_0 -)
  85. void setSupportedSubprotocols(const QStringList &protocols);
  86. %End
  87. %If (Qt_6_4_0 -)
  88. QStringList supportedSubprotocols() const;
  89. %End
  90. signals:
  91. %If (Qt_6_11_0 -)
  92. void sslErrorsOccurred(QSslSocket *socket, const QList<QSslError> &errors);
  93. %End
  94. };
  95. %End