Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.ConnectException: Connection timed out: connect

 
surendra babu k
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.net.ConnectException: Connection timed out: connect

Hi.. I am getting the above exception while sending a request to remote server....

while processing credit cards i am getting this exception

Can any one tell how can i handle that exception....

Thanks in adv.....
 
Nam Ha Minh
Ranch Hand
Posts: 502
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the server was taking so long to respond, so time out happened.
 
surendra babu k
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i handle that exception...

lets say i am processing four cards at a time...after processing 3 cards successfully if timeout exception occurs in the 4th card then my system shows the four cards are not processed because of time out exception.

 
naveen yadav
Ranch Hand
Posts: 384
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can try public void setConnectTimeout(int timeout) to set the time out period . This method may throw java.net.SocketException , so you need to handle that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic