BugInTheSYS

Untitled

Oct 4th, 2011
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1.     bool RecvData(SOCKET _rdsock, string &_rddata) {
  2.             char* _rdtemp = Char( _rddata.c_str() );
  3.      
  4.             if (recv(_rdsock, _rdtemp, 512, 0) <= 0) {
  5.                     cout << "\nError while trying to receive data...\n";
  6.                     cout << "Error: " << WSAGetLastError() << endl;
  7.                     _rddata = string( _rdtemp );
  8.                     return false;
  9.             } else {
  10.                     _rddata = _rdtemp;
  11.                     return true;
  12.             }
  13.  
  14.     }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment