From dd87ac4e088c208c68f1862c7234d273a4058a63 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Tue, 3 Sep 2013 07:58:30 -0400 Subject: [PATCH] Blocking check in ReadBuf --- mdl/m_io_sockets.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mdl/m_io_sockets.pas b/mdl/m_io_sockets.pas index 93fc694..05a5514 100644 --- a/mdl/m_io_sockets.pas +++ b/mdl/m_io_sockets.pas @@ -177,7 +177,7 @@ Begin Result := fpSend(FSocketHandle, @Buf, Len, FPSENDOPT); While (Result = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin - WaitMS(10); + WaitMS(25); Result := fpSend(FSocketHandle, @Buf, Len, FPSENDOPT); End; @@ -312,7 +312,7 @@ Begin Result := fpSend(FSocketHandle, @Temp, TempPos, FPSENDOPT); While (Result = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin - WaitMS(10); + WaitMS(25); Result := fpSend(FSocketHandle, @Temp, TempPos, FPSENDOPT); End; @@ -480,6 +480,12 @@ Begin FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT); FInBufPos := 0; + While (FInBufEnd = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin + WaitMS(25); + + FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT); + End; + If FInBufEnd <= 0 Then Begin FInBufEnd := 0; Result := -1;