Increased buffer to match in size with SharedMemoryChannel
This commit is contained in:
@@ -95,7 +95,7 @@ string SynchronousSocket::Receive(int amount)
|
|||||||
time_t start = time(NULL);
|
time_t start = time(NULL);
|
||||||
while ((int)r.length() < amount)
|
while ((int)r.length() < amount)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[BUFFER_SIZE];
|
||||||
int to_recv = min((int)sizeof(buf), amount - (int)r.length());
|
int to_recv = min((int)sizeof(buf), amount - (int)r.length());
|
||||||
int res = recv(socket, buf, to_recv, 0);
|
int res = recv(socket, buf, to_recv, 0);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class SynchronousSocket
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const int TIMEOUT = 10; // in seconds
|
const int TIMEOUT = 10; // in seconds
|
||||||
|
const int BUFFER_SIZE = 1048576;
|
||||||
protected:
|
protected:
|
||||||
// собственно сокет
|
// собственно сокет
|
||||||
int socket;
|
int socket;
|
||||||
|
|||||||
Reference in New Issue
Block a user