Page 1 of 1

Socker error on reading

Posted: Tue 17 Mar 2020 20:37
by erva
Hi,

I have following code in TLocation.LocationChanged event, using iPhone with SDAC connected to SQL Azure:

try
tblLocations.Append;
tblLocations.FieldByName('Longitude').AsString := FloatToStr(NewLocation.Longitude);
tblLocations.FieldByName('Latitude').AsString := FloatToStr(NewLocation.Latitude);
tblLocations.Post;
except
on E: Exception do
begin
ShowMessage('DATABASE ERROR ' + E.Message);
end;
end;

In outside with iPhone, i get in same location error "Socket error on reading". When moving with iPhone, app hangs and after 30-60 seconds ShowMessage dialog shows.

Is it possible that error is caused because poor cellular phone network, at area where i'am network is sometimes very bad?

It doesn't matter if location is not saved to database, but it takes too long error to rise. Is there some solution how to speed up error to raise or some other way to handle situation so that app keeps running.

TMSConnection.provider is set to "plDirect"

Re: Socker error on reading

Posted: Wed 18 Mar 2020 07:07
by Stellar
You can try setting the maximum timeout for the command execution. For TMSQuery, TMSTable, and TMSStoredProc, you can set the timeout in seconds by specifying a value in the CommandTimeout property.

More details about the CommandTimeout property:
https://www.devart.com/sdac/docs/devart ... imeout.htm