mail.smtp.connectiontimeout us not working when there is a CLOSE_WAIT state

View: New views
2 Messages — Rating Filter:   Alert me  

mail.smtp.connectiontimeout us not working when there is a CLOSE_WAIT state

by scorpion10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using JavaMail 1.4.2 and I tried to connect to a SMTP server with a port that has a CLOSE_WAIT (checked by doing a netstat) state. I have set both connectiontimeout & timeout values to 10 seconds but the calls for trans.connect() never returns or throws exception until like for 3 to 4 minutes..Could anybody please explain how  Ican overcome this problem?

Re: mail.smtp.connectiontimeout us not working when there is a CLOSE_WAIT state

by scorpion10 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did a small test with simple socket code and it seems that the problem is not in JavaMail but in the operating system itself. I ran the program in windows, solaris & linux and had this problem in both solaris & linux but not in windows...
scorpion10 wrote:
I am using JavaMail 1.4.2 and I tried to connect to a SMTP server with a port that has a CLOSE_WAIT (checked by doing a netstat) state. I have set both connectiontimeout & timeout values to 10 seconds but the calls for trans.connect() never returns or throws exception until like for 3 to 4 minutes..Could anybody please explain how  Ican overcome this problem?