The readyRead() signal is emitted whenever datagrams arrive. In that case, hasPendingDatagrams() returns true. Call pendingDatagramSize() to obtain the size of the first pending datagram, and readDatagram() or receiveDatagram() to read it.
无论什么时候,当有数据报到达,就会有一个叫 readyRead() 的信号被发出。在这种情况下,hasPendingDatagrams() 会返回一个true。调用 pendingDatagramSize() 去获取第一条在接收队列中等待取出的数据报的字节数,调用 readDatagram() 或 receiveDatagram() 可以读取数据报。