Guest User

Untitled

a guest
Nov 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. // asyncsocket.h
  2. class AsyncSocket
  3. {
  4. public:
  5. void send(const QByteArray &msg);
  6.  
  7. public slots:
  8. void readyRead();
  9.  
  10. private:
  11. QTcpSocket *socket;
  12. };
  13.  
  14. // asyncsocket.cpp
  15. void AsyncSocket::send(const QByteArray &msg)
  16. {
  17. if (socket->state() == QAbstractSocket::ConnectedState)
  18. socket->write(msg, msg.size());
  19. }
  20.  
  21. void AsyncSocket::readyRead()
  22. {
  23. qDebug() << "slot readyRead" << socket->bytesAvailable();
  24. }
  25.  
  26. ----- button clicked ------
  27. slot readyRead 1460
  28. slot readyRead 3508
  29. slot readyRead 3900
  30. ----- button clicked ------
  31. slot readyRead 2048
  32. slot readyRead 3508
  33. slot readyRead 3900
  34. ----- button clicked ------
  35. slot readyRead 2048
  36. slot readyRead 3900
  37. ----- button clicked ------
  38. slot readyRead 1460
  39. slot readyRead 2048
  40. slot readyRead 3508
  41. slot readyRead 3900
  42.  
  43. # | Source | Destination | Prot| len | Info
  44. 25 | 192.168.51.57 | 192.168.51.63 | TCP | 3954 | 50597 → 9025 [PSH, ACK] Seq=1 Ack=1 Win=64240 Len=3900
  45.  
  46. 27 | 192.168.51.63 | 192.168.51.57 | TCP | 1514 | 9025 → 50597 [ACK] Seq=1 Ack=3901 Win=7300 Len=1460
  47. 28 | 192.168.51.63 | 192.168.51.57 | TCP | 642 | 9025 → 50597 [PSH, ACK] Seq=1461 Ack=3901 Win=7300 Len=588
  48. 30 | 192.168.51.63 | 192.168.51.57 | TCP | 1514 | 9025 → 50597 [ACK] Seq=2049 Ack=3901 Win=7300 Len=1460
  49. 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