private Int32 DataSocketReceive(Byte[] buffer, Int32 offset, Int32 size)
{
Int32 lTotalReadBytes = 0;
do
{
Int32 lReadBytes = this.DataSocketReceiveWhatsAvaiable(buffer, offset, size);
if (lReadBytes == 0)
{
return lTotalReadBytes;
}
size -= lReadBytes;
offset += lReadBytes;
lTotalReadBytes += lReadBytes;
}
while (size > 0);
return lTotalReadBytes;
}