Blocking check in ReadBuf

This commit is contained in:
mysticbbs 2013-09-03 07:58:30 -04:00
parent 9ee5efdf96
commit dd87ac4e08
1 changed files with 8 additions and 2 deletions

View File

@ -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;