private Int32 NativeDataSocketReceiveWhatsAvaiable(Byte[] buffer, Int32 offset, Int32 size)
{
this.StartTimeoutTimer();
try
{
Int32 lBytesRead = this.fSslStream.Read(buffer, offset, size);
// Say 'Hi!' to Mono bugs
if (lBytesRead < 0)
{
throw new SocketException();
}
return lBytesRead;
}
catch (IOException)
{
throw new SocketException();
}
finally
{
this.StopTimeoutTimer();
}
}