Blocking check in ReadBuf
This commit is contained in:
parent
9ee5efdf96
commit
dd87ac4e08
|
@ -177,7 +177,7 @@ Begin
|
||||||
Result := fpSend(FSocketHandle, @Buf, Len, FPSENDOPT);
|
Result := fpSend(FSocketHandle, @Buf, Len, FPSENDOPT);
|
||||||
|
|
||||||
While (Result = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin
|
While (Result = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin
|
||||||
WaitMS(10);
|
WaitMS(25);
|
||||||
|
|
||||||
Result := fpSend(FSocketHandle, @Buf, Len, FPSENDOPT);
|
Result := fpSend(FSocketHandle, @Buf, Len, FPSENDOPT);
|
||||||
End;
|
End;
|
||||||
|
@ -312,7 +312,7 @@ Begin
|
||||||
Result := fpSend(FSocketHandle, @Temp, TempPos, FPSENDOPT);
|
Result := fpSend(FSocketHandle, @Temp, TempPos, FPSENDOPT);
|
||||||
|
|
||||||
While (Result = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin
|
While (Result = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin
|
||||||
WaitMS(10);
|
WaitMS(25);
|
||||||
|
|
||||||
Result := fpSend(FSocketHandle, @Temp, TempPos, FPSENDOPT);
|
Result := fpSend(FSocketHandle, @Temp, TempPos, FPSENDOPT);
|
||||||
End;
|
End;
|
||||||
|
@ -480,6 +480,12 @@ Begin
|
||||||
FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT);
|
FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT);
|
||||||
FInBufPos := 0;
|
FInBufPos := 0;
|
||||||
|
|
||||||
|
While (FInBufEnd = -1) and (SocketError = ESOCKEWOULDBLOCK) Do Begin
|
||||||
|
WaitMS(25);
|
||||||
|
|
||||||
|
FInBufEnd := fpRecv(FSocketHandle, @FInBuf, TIOBufferSize, FPRECVOPT);
|
||||||
|
End;
|
||||||
|
|
||||||
If FInBufEnd <= 0 Then Begin
|
If FInBufEnd <= 0 Then Begin
|
||||||
FInBufEnd := 0;
|
FInBufEnd := 0;
|
||||||
Result := -1;
|
Result := -1;
|
||||||
|
|
Loading…
Reference in New Issue