May 2019
Intermediate to advanced
542 pages
13h 37m
English
UDP is most commonly used in broadcast applications on local networks, so to demonstrate this, we're going to make our UDP chat a local-network-only broadcast chat. That means that any computer on a local network running a copy of this application will be able to view and participate in the conversation.
We'll start by creating our backend class, which we'll call UdpChatInterface:
class UdpChatInterface(qtc.QObject): port = 7777 delimiter = '||' received = qtc.pyqtSignal(str, str) error = qtc.pyqtSignal(str)
Our backend inherits QObject so that we can use Qt signals, of which we've defined two—a received signal that we'll emit when a message is received, and an error signal that we'll emit when an error happens. ...
Read now
Unlock full access