geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Warner" <jaw...@gmail.com>
Subject while(true) in getConnectedSSLSocket Method in SMTPTransport.java
Date Mon, 04 Dec 2006 21:05:24 GMT
Hey all,

I was looking at the getConnectedSSLSocket method in the
SMTPTransport.javaclass for javamail and I was confused.  There is a
section that consists of
a while loop whose condition is true.  Within this while loop is code to
create a socket connection with a server.  I am confused as to how this
works.  Shouldn't there be some condition such that if the socket has been
connected then you break out of the while loop?  I used this piece of code
in the pop3Connection class for establishing an SSL connection when using
pop3.  When I try to run it I get a bind exception.  I believe this is
caused by that while loop not being exited when the socket is created.  I
can add in those break statements but I was curious how it works for smtp.
There are no break statements in that piece of code so I was wondering if
there's another way it works.  Is there a different reason why creating the
socket would break out of the while loop that I'm not encountering?  Thanks.

Jason

Mime
View raw message