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

Method Protocol

app/src/main/java/com/sun/mail/iap/Protocol.java:98–133  ·  view source on GitHub ↗

Constructor. Opens a connection to the given host at given port. @param host host to connect to @param port portnumber to connect to @param props Properties object used by this protocol @param prefix Prefix to prepend to property keys @param isSSL use SSL? @param logger log messages her

(String host, int port, 
		    Properties props, String prefix,
		    boolean isSSL, MailLogger logger)

Source from the content-addressed store, hash-verified

96 * @exception ProtocolException for protocol failures
97 */
98 public Protocol(String host, int port,
99 Properties props, String prefix,
100 boolean isSSL, MailLogger logger)
101 throws IOException, ProtocolException {
102 boolean connected = false; // did constructor succeed?
103 tagPrefix = computePrefix(props, prefix);
104 try {
105 this.host = host;
106 this.props = props;
107 this.prefix = prefix;
108 this.logger = logger;
109 traceLogger = logger.getSubLogger("protocol", null);
110
111 socket = SocketFetcher.getSocket(host, port, props, prefix, isSSL);
112 quote = PropUtil.getBooleanProperty(props,
113 "mail.debug.quote", false);
114
115 initStreams();
116
117 // Read server greeting
118 processGreeting(readResponse());
119
120 timestamp = System.currentTimeMillis();
121
122 connected = true; // must be last statement in constructor
123 } finally {
124 /*
125 * If we get here because an exception was thrown, we need
126 * to disconnect to avoid leaving a connected socket that
127 * no one will be able to use because this object was never
128 * completely constructed.
129 */
130 if (!connected)
131 disconnect();
132 }
133 }
134
135 private void initStreams() throws IOException {
136 traceInput = new TraceInputStream(socket.getInputStream(), traceLogger);

Callers

nothing calls this directly

Calls 9

computePrefixMethod · 0.95
getSocketMethod · 0.95
getBooleanPropertyMethod · 0.95
initStreamsMethod · 0.95
processGreetingMethod · 0.95
readResponseMethod · 0.95
disconnectMethod · 0.95
getSubLoggerMethod · 0.80
setQuoteMethod · 0.45

Tested by

no test coverage detected