Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void serverFunction()
- {
- /* установка сокета*/
- //вот тут идёт общение с клиентом
- while (true)
- {
- int bytesReceived = recv(clientSocket, buf, 4096, 0);
- send(clientSocket, buf, bytesReceived + 1, 0);
- }
- // Close the socket
- }
- int main()
- {
- std::thread thr(serverFunction);
- // весь остальной код
- }
Advertisement
Add Comment
Please, Sign In to add comment