Winsock recv all bytes
Regarding improving the code, here are some suggestions:


Reduce the number of conditions/loops. The whole method is doable in a single while loop. See below for an example.
Prefer nouns for names of variables and verbs for functions/methods. For instance, instead of calling the return value ReturnCheck, call it ReturnValue.
Refactor the code to handle the connection getting closed before getting all of the expected bytes. According to a Microsoft Winsock web page for the recv call, "If the connection has been gracefully closed, the return value is zero". At which point I believe your code will try again and get SOCKET_ERROR (with an error code of WSAENOTCONN). And then return false even though it may have missed only say the last byte expected.
Recognize values that are constant with the C++ const type qualifier (or constexpr as you've done for compile-time constants).
Seeing as how you used constexpr (available since C++11), go ahead and also prefer using auto.
Consider making the RecvAllBytes method a method of a class that the client can use too (I don't demonstrate this though).


Here's how this could look (I didn't compile and test this code but hopefully it works):

int Server::RecvAllBytes(std::shared_ptr&lt;Connection&gt; connection, char * data, int bytesExpected)
{
    WSASetLastError(0);

    auto bytesReceived = decltype(bytesExpected){0};
    while (bytesExpected &gt; 0)
    {
        const auto bytesRequested = (bytesExpected &gt; maxBufferSize)? maxBufferSize: bytesExpected;
        const auto returnValue = recv(connection-&gt;socket, data + bytesReceived, bytesRequested);
        if (returnValue == -1 || returnValue == 0)
        {
            return bytesReceived;
        }
        bytesReceived += returnValue;
        bytesExpected -= returnValue;
    }
    return bytesReceived;
}


And how it could be used:

const auto bytesReceived = server.RecvAllBytes(connection, bigBuffer, bigSize);
if (bytesReceived &lt; bigSize)
{
    if (WSAGetLastError() != 0)
    {
        // handle error.
    }
    else
    {
        // handle connection closed before all bytes received.
    }
}