Socker error on reading

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
erva
Posts: 8
Joined: Sat 29 Feb 2020 15:59

Socker error on reading

Post by erva » Tue 17 Mar 2020 20:37

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"

Stellar
Devart Team
Posts: 347
Joined: Tue 03 Oct 2017 11:00

Re: Socker error on reading

Post by Stellar » Wed 18 Mar 2020 07:07

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

Post Reply