Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // asyncsocket.h
- class AsyncSocket
- {
- public:
- void send(const QByteArray &msg);
- public slots:
- void readyRead();
- private:
- QTcpSocket *socket;
- };
- // asyncsocket.cpp
- void AsyncSocket::send(const QByteArray &msg)
- {
- if (socket->state() == QAbstractSocket::ConnectedState)
- socket->write(msg, msg.size());
- }
- void AsyncSocket::readyRead()
- {
- qDebug() << "slot readyRead" << socket->bytesAvailable();
- }
- ----- button clicked ------
- slot readyRead 1460
- slot readyRead 3508
- slot readyRead 3900
- ----- button clicked ------
- slot readyRead 2048
- slot readyRead 3508
- slot readyRead 3900
- ----- button clicked ------
- slot readyRead 2048
- slot readyRead 3900
- ----- button clicked ------
- slot readyRead 1460
- slot readyRead 2048
- slot readyRead 3508
- slot readyRead 3900
- # | Source | Destination | Prot| len | Info
- 25 | 192.168.51.57 | 192.168.51.63 | TCP | 3954 | 50597 → 9025 [PSH, ACK] Seq=1 Ack=1 Win=64240 Len=3900
- 27 | 192.168.51.63 | 192.168.51.57 | TCP | 1514 | 9025 → 50597 [ACK] Seq=1 Ack=3901 Win=7300 Len=1460
- 28 | 192.168.51.63 | 192.168.51.57 | TCP | 642 | 9025 → 50597 [PSH, ACK] Seq=1461 Ack=3901 Win=7300 Len=588
- 30 | 192.168.51.63 | 192.168.51.57 | TCP | 1514 | 9025 → 50597 [ACK] Seq=2049 Ack=3901 Win=7300 Len=1460
- 31 | 192.168.51.63 | 192.168.51.57 | TCP | 446 | 9025 → 50597 [PSH, ACK] Seq=3509 Ack=3901 Win=7300 Len=392
Add Comment
Please, Sign In to add comment