qtcpserver.sip 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // qtcpserver.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNetwork 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. class QTcpServer : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qtcpserver.h>
  25. %End
  26. public:
  27. explicit QTcpServer(QObject *parent /TransferThis/ = 0);
  28. virtual ~QTcpServer();
  29. bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
  30. void close();
  31. bool isListening() const;
  32. void setMaxPendingConnections(int numConnections);
  33. int maxPendingConnections() const;
  34. quint16 serverPort() const;
  35. QHostAddress serverAddress() const;
  36. qintptr socketDescriptor() const;
  37. bool setSocketDescriptor(qintptr socketDescriptor);
  38. bool waitForNewConnection(int msecs = 0, bool *timedOut = 0) /ReleaseGIL/;
  39. virtual bool hasPendingConnections() const;
  40. virtual QTcpSocket *nextPendingConnection();
  41. QAbstractSocket::SocketError serverError() const;
  42. QString errorString() const;
  43. void setProxy(const QNetworkProxy &networkProxy);
  44. QNetworkProxy proxy() const;
  45. void pauseAccepting();
  46. void resumeAccepting();
  47. protected:
  48. virtual void incomingConnection(qintptr handle);
  49. void addPendingConnection(QTcpSocket *socket);
  50. signals:
  51. void newConnection();
  52. void acceptError(QAbstractSocket::SocketError socketError);
  53. public:
  54. %If (Qt_6_3_0 -)
  55. void setListenBacklogSize(int size);
  56. %End
  57. %If (Qt_6_3_0 -)
  58. int listenBacklogSize() const;
  59. %End
  60. signals:
  61. %If (Qt_6_4_0 -)
  62. void pendingConnectionAvailable();
  63. %End
  64. };