EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SocketTimout problems

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#37603
Posted: 08/31/2016 06:25:22
by Romana Romandini (Standard support level)
Joined: 10/22/2013
Posts: 34

If I open a folder (In all services: google drive, one drive, dropbox, amazon, azure ...) that contains a lot of files, the ".list" method triggers SocketTimout state and stop the operation before it is finished.
But if the socket timeout value is too high other problems/errors (such as lack of connection) does not trigger/occour.
In my humble opinion ".list" method should not trigger socket timeout.
How I can do?
#37609
Posted: 09/01/2016 02:59:03
by Alexander Ionov (EldoS Corp.)

Thank you for reporting this.

The timeout error is reported by the underlying transport class, not the List methods. The error occurs only if there is no data received during the specified time interval, i.e. only if the server side doesn't send anything (for example, it assembles a complete list of files) during the timeout interval.

I'd suggest you to increase TElHTTPSClient.SocketTimeout property value before calling the List methods, and restore the timeout value back after you've got the files list.


--
Best regards,
Alexander Ionov
#37611
Posted: 09/01/2016 05:24:24
by Romana Romandini (Standard support level)
Joined: 10/22/2013
Posts: 34

Thanks for the idea, but unfortunately this does not resolve my problems.
There is also another problem: if the socket timeout value is very high or equal to 0, in some cases, ".list" returned error "connection lost" after about 80 seconds, and it does not return anything.


#37612
Posted: 09/01/2016 05:30:09
by Alexander Ionov (EldoS Corp.)

Thank you for the details.

How many files should be on the server to have the issue appeared? We'd like to check what exactly occurs in the transport component.


--
Best regards,
Alexander Ionov
#37613
Posted: 09/01/2016 05:38:12
by Romana Romandini (Standard support level)
Joined: 10/22/2013
Posts: 34

In my case they are 7000
#37614
Posted: 09/01/2016 05:40:40
by Paolo Righi (Standard support level)
Joined: 02/15/2008
Posts: 34

Hi Romana and Alexander,

as the time-out error is rather frequent accessing (free) cloud storages I changed the TElHTTPSClient.PerformRequest function adding a retry cycle like that below:

while True do begin
if Active then
Break;
try
Open;
Break;
except
on E: EElSSLClientConnectionLostError do
begin
iError := E.ErrorCode;
end;
on E: EElSimpleSSLClientError do
begin
iError := E.ErrorCode;
end;
on E: EElSocketError do
begin
iError := E.ErrorCode;
end;
end;
try
Close(True);
except
end;
Closed := true;
bToRetry := (iError = SB_SOCKET_ERROR_CODE_TIMEDOUT) or
(iError = SB_SOCKET_ERROR_TIMEOUT) or
(iError = ERROR_SSL_TIMEOUT);
if bToRetry then begin
bCancel := False;
DoRetry(iError, bCancel); // you should declare a new event handler
if bCancel then
raise EAbort.Create('Timeout');
end;
Closed := false;
end;

Maybe this could be a suggestion that can be included in the package.

Best regards.

Paolo Righi.
#37620
Posted: 09/02/2016 10:49:45
by Eugene Mayevski (EldoS Corp.)

Paolo, your code is about opening a connection, not about a particular method sent over the connection.

The reason why we don't have automatic retries in any components (for operations or for connection establishment either) is that they can't cover all complex scenarios, which can take place during the operation.

On a side note it would help a lot if you used CODE button located above the text entry box (alternatively you can write [ CODE ] and [ /CODE ] tags by hand) to mark the beginning and the end of the code blocks in your messages. This would enable syntax highlighting and line numbering on the code and make it easier for analysis.


Sincerely yours
Eugene Mayevski
#37639
Posted: 09/06/2016 03:16:34
by Romana Romandini (Standard support level)
Joined: 10/22/2013
Posts: 34

news?
#37640
Posted: 09/06/2016 05:20:54
by Alexander Ionov (EldoS Corp.)

Unfortunately we're unable to reproduce the issue on our side. I've just uploaded over 8000 files to our Google Drive test account and opened the folder in our GDrive sample - all works fine, no exception is raised.

Will check the same with Dropbox and OneDrive later this week.


--
Best regards,
Alexander Ionov
#37799
Posted: 09/27/2016 11:58:05
by Romana Romandini (Standard support level)
Joined: 10/22/2013
Posts: 34

News for OneDrive and Dropbox?
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 1278 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!