fix warnings on compile:

- raise Exception.Create instead of Exception.Toss (deprecated)
  - ReadUInt32 instead of ReadLogWord (deprecated)
This commit is contained in:
Tuncay Goncuoglu 2017-05-10 14:00:07 +03:00
parent 8a611e9074
commit 2a7dde753d
3 changed files with 6 additions and 6 deletions

View file

@ -830,7 +830,7 @@ begin
strmEvent.Clear;
//first is the data type TWSDataType(text or bin), but is ignore/not needed
wscode := TWSDataCode(IOHandler.ReadLongWord);
wscode := TWSDataCode(IOHandler.ReadUInt32);
if not (wscode in [wdcText, wdcBinary, wdcPing, wdcPong]) then
begin
//Sleep(0);

View file

@ -416,12 +416,12 @@ begin
begin
CheckForDisconnect; //disconnected during wait in "Readable()"?
if not Opened then
EIdNotConnected.Toss(RSNotConnected)
raise EIdNotConnected.Create(RSNotConnected)
else if not SourceIsAvailable then
EIdClosedSocket.Toss(RSStatusDisconnected);
raise EIdClosedSocket.Create(RSStatusDisconnected);
GStack.CheckForSocketError(GStack.WSGetLastError); //check for socket error
if ARaiseExceptionOnTimeout then
EIdReadTimeout.Toss(RSIdNoDataToRead) //exit, no data can be received
raise EIdReadTimeout.Create(RSIdNoDataToRead) //exit, no data can be received
else
Exit(0);
end;
@ -433,7 +433,7 @@ begin
CheckForDisconnect; //disconnected in the mean time?
GStack.CheckForSocketError(GStack.WSGetLastError); //check for socket error
if ARaiseExceptionOnTimeout then
EIdNoDataToRead.Toss(RSIdNoDataToRead); //nothing read? then connection is probably closed -> exit
raise EIdNoDataToRead.Create(RSIdNoDataToRead); //nothing read? then connection is probably closed -> exit
end;
SetLength(VBuffer, Result);
end;

View file

@ -95,7 +95,7 @@ begin
strmRequest.Position := 0;
//first is the type: text or bin
wscode := TWSDataCode(context.IOHandler.ReadLongWord);
wscode := TWSDataCode(context.IOHandler.ReadUInt32);
//then the length + data = stream
context.IOHandler.ReadStream(strmRequest);
strmRequest.Position := 0;