daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void ReadThread::run(Client& client)
  2. {
  3.     QString result;
  4.  
  5.     while (1)
  6.     {
  7.         result = client.receiveText();
  8.         emit  messageReceived(result);
  9.     }
  10. }
  11.  
  12.  
  13. QString Client::receiveText()
  14. {
  15.     int     bytesToRead;
  16.     char    *bp;
  17.     size_t  i;
  18.     QString *result;
  19.  
  20.     bp = Client::rbuf_;
  21.     bytesToRead = BUFLEN;
  22.  
  23.     i = 0;
  24.     while ((i = recv (Client::clSocket_, bp, bytesToRead, 0)) < BUFLEN)
  25.     {
  26.             bp += i;
  27.             bytesToRead -= i;
  28.     }
  29.     result = new QString(rbuf_);
  30.     return(*result);
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top