Guest User

Untitled

a guest
May 12th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. void serverFunction()
  2. {
  3.  
  4. /* установка сокета*/
  5. //вот тут идёт общение с клиентом
  6. while (true)
  7. {
  8.  
  9. int bytesReceived = recv(clientSocket, buf, 4096, 0);
  10. send(clientSocket, buf, bytesReceived + 1, 0);
  11. }
  12.  
  13. // Close the socket
  14.  
  15. }
  16.  
  17. int main()
  18. {
  19. std::thread thr(serverFunction);
  20. // весь остальной код
  21. }
Advertisement
Add Comment
Please, Sign In to add comment