Mega Search
23.2 Million


Sign Up

Make a donation  
TIdPOP3->Connect() doesn't return  
News Group: borland.public.cppbuilder.internet.socket

   I'm using TIdPOP3 with Indy 9.0.17 and BCB5. Thanks to Remy the 
diagnostics via exception is working, except in two cases where the 
Connect(5000) command doesn't ever return, hanging the application.

- If I set Port to a working non POP port (80, for example)
- If I activate SSL for a non-SSL server

   The programs works OK with a GMail account (port 995 and SSL ON), so 
I think this is not the problem.

   This cases are possible, as the users are not experts. Is there any 
way to avoid this?

TIA
Miguel Gimenez

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 5-Dec-2007, at 12:47 AM EST
From: Miguel Gimenez
 
Re: TIdPOP3->Connect() doesn't return  
News Group: borland.public.cppbuilder.internet.socket
Remy Lebeau (TeamB) escribió:
> "Miguel Gimenez"  wrote in message 
> news:47566e9d$1@newsgroups.borland.com...
> 
>> I thought that the Connect() timeout was enough
> 
> No, because this is not a connection issue, it is a data reading issue. 
> There are separate timeouts for those issues.
> 
>> The SSL part still hangs, I've been looking for timeouts
>> in this component to no avail.
> 
> There aren't any.  What is our EXACT setup when using TIdPOP3 with SSL?

IdPOP31:
APOP = false
ASCIIFilter = false
BoundIP = ""
BoundPort = 0
Host = "pop.solener.com"
Intercept = ""
IOHandler = UseSSL ? IdSSLIOHandlerSocket1 : NULL
MaxLineAction = maSplit
MaxLineLength = 16384
Name = "IdPOP31"
Password = "password"
Port = 110
ReadTimeout = 6000
RecvBufferSize = 32768
SendBufferSize = 32768
Tag = 0
Username = "username"

IdSSLIOHandlerSocket1:
Name = "IdSSLIOHandlerSocket1"
SocksInfo = ""
SSLOptions
   CertFile = ""
   CipherList = ""
   KeyFile = ""
   Method = sslvSSLv2
   Mode = sslmUnassigned
   RootCertFile = ""
   VerifyDepth = 0
   VerifyDirs = 0
   VerifyMode = []
Tag = 0
UseNagle = true

The program works fine with "normal servers" (port 110, no SSL) and 
Gmail (port 995, SSL).

If I set no SSL for a Gmail server I get an EIdReadTimeout exception, as 
expected.

If I set SSL for a non-SSL server, the applications hangs on 
IdPOP31->Connect().

I'm using the OpenSSL library pair from the Indy page. Maybe one of 
these libraries who halts waiting for a valid SSL packet.

Best regards
Miguel Gimenez

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 5-Dec-2007, at 9:34 PM EST
From: Miguel Gimenez
 
Re: TIdPOP3->Connect() doesn't return  
News Group: borland.public.cppbuilder.internet.socket
"Miguel Gimenez"  wrote in message 
news:47566e9d$1@newsgroups.borland.com...

> I thought that the Connect() timeout was enough

No, because this is not a connection issue, it is a data reading issue. 
There are separate timeouts for those issues.

> The SSL part still hangs, I've been looking for timeouts
> in this component to no avail.

There aren't any.  What is our EXACT setup when using TIdPOP3 with SSL?


Gambit 



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 5-Dec-2007, at 9:59 AM EST
From: Remy Lebeau \(TeamB\)
 
Re: TIdPOP3->Connect() doesn't return  
News Group: borland.public.cppbuilder.internet.socket
Remy Lebeau (TeamB) wrote:
>> Is there any way to avoid this?
> 
> Set the ReadTimeout property.  It is set to infinite by default.

I thought that the Connect() timeout was enough, now the wrong port part 
works correctly.

The SSL part still hangs, I've been looking for timeouts in this 
component to no avail.

--
Best regards
Miguel Gimenez

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 5-Dec-2007, at 10:25 AM EST
From: Miguel Gimenez
 
Re: TIdPOP3->Connect() doesn't return  
News Group: borland.public.cppbuilder.internet.socket
"Miguel Gimenez"  wrote in message 
news:4755e726$1@newsgroups.borland.com...

> - If I set Port to a working non POP port (80, for example)

The POP3 protocol defines a greeting command that the server is required to 
send to the client upon initial connection.  TIdPOP3::Connect() waits for 
that greeting to arrive.  Port 80, however, is an HTTP port, not a POP3 
port.  The HTTP protocol has no greeting.  So Connect() establishes a 
connection to a server but then ends up waiting for data that never arrives.

> Is there any way to avoid this?

Set the ReadTimeout property.  It is set to infinite by default.


Gambit



Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 4-Dec-2007, at 4:34 PM EST
From: Remy Lebeau \(TeamB\)