From b88d21d4cf2056eb57c6417cfdeff1d39e052b84 Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Thu, 2 Mar 2023 23:12:46 +0300 Subject: [PATCH] Increased buffer to match in size with SharedMemoryChannel --- server/SynchronousSocket.cpp | 2 +- server/SynchronousSocket.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/SynchronousSocket.cpp b/server/SynchronousSocket.cpp index a8da3f7..4b32552 100644 --- a/server/SynchronousSocket.cpp +++ b/server/SynchronousSocket.cpp @@ -95,7 +95,7 @@ string SynchronousSocket::Receive(int amount) time_t start = time(NULL); while ((int)r.length() < amount) { - char buf[1024]; + char buf[BUFFER_SIZE]; int to_recv = min((int)sizeof(buf), amount - (int)r.length()); int res = recv(socket, buf, to_recv, 0); if (res == 0) diff --git a/server/SynchronousSocket.h b/server/SynchronousSocket.h index 8fd126e..6fcaee4 100644 --- a/server/SynchronousSocket.h +++ b/server/SynchronousSocket.h @@ -9,6 +9,7 @@ class SynchronousSocket { private: const int TIMEOUT = 10; // in seconds + const int BUFFER_SIZE = 1048576; protected: // собственно сокет int socket;