Click to See Complete Forum and Search --> : question > javax.mail java.net


btheg
February 5th, 2003, 10:10 AM
hi,

following problem:
my email client is trying to connet to mailserver.
but theres no inet connection.
i get a unknownhosexception
how can i check out if theres any inetconnection ?
the source of the problem is, that if theres
a unknownhostexception thrown for the first time
i have to restart my client. because anytime i try
to connect to server again this exception is thrown.
but i have already opened a inetconnection.

btheg
February 9th, 2003, 11:45 AM
oh btheg you dummie itīs very simple
you just have to call
InetSocketAddress isa = new InetSocketAddress("pop3host", 110);
if(isa.isUnresolved())
{
//semms like you got no inetconnection
}
so you can prevent that a UnknownHostException
is thrown if theres no inetconnection