Advertisement
Benjamin_Loison

Network windows

Jul 9th, 2017
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #ifdef _WIn32
  2.             int lengthTemp = recv(socketId, bufferTmp, 1, 0), error = WSAGetLastError();
  3.             if(lengthTemp == 0 && error == 0)
  4.                 sendStr(" ");
  5.             if(error == 10053)
  6.             {
  7.                 log("Server closed");
  8.                 connected = 0;
  9.                 break;
  10.             }
  11.         #elifndef
  12.             if(recv(socketId, NULL, 1, MSG_PEEK | MSG_DONTWAIT) == 0)
  13.             {
  14.                 cout << "Server closed" << endl;
  15.                 connected = 0;
  16.                 break;
  17.             }
  18.         #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement