MCPcopy Create free account
hub / github.com/M66B/FairEmail / isConnected

Method isConnected

app/src/main/java/com/sun/mail/pop3/POP3Store.java:215–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

213 * need to be able to reconnect the Store on demand.
214 */
215 @Override
216 public synchronized boolean isConnected() {
217 if (!super.isConnected())
218 // if we haven't been connected at all, don't bother with
219 // the NOOP.
220 return false;
221 try {
222 if (port == null)
223 port = getPort(null);
224 else if (!port.noop())
225 throw new IOException("NOOP failed");
226 return true;
227 } catch (IOException ioex) {
228 // no longer connected, close it down
229 try {
230 super.close(); // notifies listeners
231 } catch (MessagingException mex) {
232 // ignore it
233 }
234 return false;
235 }
236 }
237
238 synchronized Protocol getPort(POP3Folder owner) throws IOException {
239 Protocol p;

Callers 1

checkConnectedMethod · 0.45

Calls 3

getPortMethod · 0.95
noopMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected