Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMAP - debug a EIdSocketError # 10060 connection timeout error under a complex env.
#2
(10-27-2018, 01:41 PM)edwinyzh Wrote: My multi-threaded program uses TidIMAP4 to access Gmail's IMAP server with OAuth 2 authentication. 

Indy does not support OAuth2, what are you using for that?

(10-27-2018, 01:41 PM)edwinyzh Wrote: With the setup my program's thread 2 had several successful login, but most of the time, it fails to connect with the 'EIdSocketError: Socket Error # 10060 Connection timed out.' error.

Are you using a non-infinite ConnectTimeout?

(10-27-2018, 01:41 PM)edwinyzh Wrote: With TIdLogEvent I can see that there is no data coming in and out.

The TIdLog... components don't really log the underlying connection activity, other than attempts to connect and disconnect, but not what those actions do internally. The components are more to log application-level data instead. So, if there is no connection, there is no application data being exchanged, so there is nothing meaningful to log.

(10-27-2018, 01:41 PM)edwinyzh Wrote: And this is thread 2, but thread 1 is ok - it can connect, login, select mailbox, and so on.

Well, then you don't really have a networking problem. Unless TIdIMAP4 in thread 2 is trying to use a different network than the one that TIdIMAP4 in thread 1 is using. Are you using the TIdIMAP4.BoundIP property at all to control which network TIdIMAP4 actually uses? If not, then it is up to the OS to decide, not Indy.

(10-27-2018, 01:41 PM)edwinyzh Wrote: I know the issue might come from the GFW, but the strange thing is why 'thread 1' can login but 'thread 2' fails? They login with the same function and same parameters.

Does thread 2 use its own local instance of TIdIMAP4? Or is it sharing TIdIMAP4 with thread 1?

(10-27-2018, 01:41 PM)edwinyzh Wrote: PS, the program most of the time works with direction Internet connection on a remote windows VPS which is located in the US, but still sometimes it gets the "EIdReplyIMAP4Error" exception

That has nothing to do with networking. EIdReplyIMAP4Error is raised whenever TIdIMAP4 receives an error message from the IMAP4 server itself. That is something you can use the TIdLog... components to diagnose, at least.

Reply


Messages In This Thread
RE: IMAP - debug a EIdSocketError # 10060 connection timeout error under a complex env. - by rlebeau - 10-29-2018, 07:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)