Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IMAP - debug a EIdSocketError # 10060 connection timeout error under a complex env.
#3
Thanks for the help @rlebeau, please find my replies start with 'edwin:' below.

(10-29-2018, 07:42 PM)rlebeau Wrote:
(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?

Edwin: Forgot to gave details, I use a modified version of https://github.com/lordcrc/IndySASLOAuth2 (internally uses tms cloud pack)

(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?
edwin: No, I use the default timeout values.


(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.

Edwin: No, I don't use BoundIP.

(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?
Edwin: Each thread has its own instance of TidImap4, but using the same property setup to connect and login.
Reply


Messages In This Thread
RE: IMAP - debug a EIdSocketError # 10060 connection timeout error under a complex env. - by edwinyzh - 10-30-2018, 08:21 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)