What is the maximum number of bytes WSARecv can receive at one time?
===

I'm using std::vector to represent a buffer in my per IO data structure:

    struct PerIoData 
    {
        WSAOVERLAPPED m_overlapped;
        SOCKET m_socket;
        WSABUF m_wsaBuf;
        std::vector<BYTE> m_vecBuffer;
        DWORD m_dwFlags;
        DWORD m_dwNumberOfBytesSent;
        DWORD m_dwNumberOfBytesToSend;
        eOperationType m_operationType;
    };

    ...
    ...
    if (WSARecv(pPerIoData->m_socket, &(pPerIoData->m_wsaBuf), 1, &dwNumberOfBytesReceived, &(pPerIoData->m_dwFlags), &(pPerIoData->m_overlapped), NULL) == 0)
        continue;

I want to specify the maximum size and perform "shrink to fit" on m_vecBuffer after calling WSARecv().

I've had a look at [this page][1] but been unable to find the information I'm looking for.


  [1]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms741688%28v=vs.85%29.aspx