IdTCPServerExecute函数接受不到数据

void __fastcall TfrmMain::IdTCPServerExecute(TIdContext *AContext)
{
CoInitialize(NULL);
try

    TCommHead Head = RecvHead(AContext->Connection);
    TCommRequest Request = RecvRequest(AContext->Connection, Head);
    TCommAnswer Answer;
    Answer.Init();

switch (Head.CommType)
{
case cs_Comm_Request_OpenSQL:
{
TADOConnection *Connection = FPoolerMan->LockConnection(
AContext->Connection->Socket->Binding->Handle, Request.ConnectID);

            if ( Connection == NULL )
            {
                Answer.ErrorNo = -1;
                Answer.ErrorInfo = SERVER_IS_BUSY;

                SendAnswer(Head.CommType, Answer, AContext->Connection);
            }
            else
            {

                    Answer.ErrorNo = -1;
                    Answer.ErrorInfo = "无效的SQL";

                    SendAnswer(Head.CommType, Answer, AContext->Connection);

                    WriteLog("IP:" + AContext->Binding()->PeerIP + " " + Request.CommandText);

                }
            }

            break;
        }
        case cs_Comm_Request_OpenFunc:  // 执行功能,返回结果集
        {
            TADOConnection *Connection = FPoolerMan->LockConnection(
                AContext->Connection->Socket->Binding->Handle, Request.ConnectID);

            if ( Connection == NULL )
            {
                Answer.ErrorNo = -1;
                Answer.ErrorInfo = SERVER_IS_BUSY;

                SendAnswer(Head.CommType, Answer, AContext->Connection);
            }
            else
            {
                TMemoryStream *mm = new TMemoryStream();
                try
                {


                    SendAnswer(Head.CommType, Answer, AContext->Connection, mm);

                }
                __finally
                {}
            }

            break;
        }


        }
        default:
            ;
    }
}
__finally
{
    CoUninitialize;
}

}

如果客户端连接300个左右有时候就接受不到数据 大神求解