Skip to content

TcpServer

Qt Base Class: QTcpServer

Signature: QTcpServer(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QTcpServer
PySide6.QtNetwork
QTcpServer(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473574006592["network.TcpServer"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473573822128["QtNetwork.QTcpServer"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473574006592
  140713234304496 --> 1473299815024
  1473573822128 --> 1473574006592
  1473288842240 --> 1473573822128
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QTcpServer

TCP-based server.

Source code in prettyqt\network\tcpserver.py
class TcpServer(core.ObjectMixin, network.QTcpServer):
    """TCP-based server."""

    def listen(  # type: ignore
        self, address: str | network.QHostAddress, port: int = 0
    ) -> bool:
        if isinstance(address, str):
            address = network.HostAddress(address)
        return super().listen(address, port)

    def get_server_address(self) -> network.HostAddress:
        return network.HostAddress(self.serverAddress())

    def get_proxy(self) -> network.NetworkProxy:
        return network.NetworkProxy(self.proxy())

    def get_server_error(self) -> network.abstractsocket.SocketErrorStr:
        return network.abstractsocket.SOCKET_ERROR.inverse[self.serverError()]

⌗ Property table

Qt Property Type Doc
objectName QString