Changeset 7
- Timestamp:
- 09/25/02 13:58:11 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/mail/ImapSession.java
r2 r7 3 3 * 4 4 * Copyright (C) 2000-2002 Peter Graves 5 * $Id: ImapSession.java,v 1. 1.1.1 2002-09-24 16:10:12piso Exp $5 * $Id: ImapSession.java,v 1.2 2002-09-25 13:58:11 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 59 59 private final int port; 60 60 61 private String tunnelHost; 62 private int tunnelPort = -1; 61 63 private ImapMailbox mailbox; 62 64 private int state; … … 140 142 } 141 143 144 public void setTunnel(String tunnel) 145 { 146 if (tunnel != null) { 147 tunnel = tunnel.trim(); 148 int colon = tunnel.indexOf(':'); 149 if (colon > 0) { 150 tunnelHost = tunnel.substring(0, colon); 151 try { 152 tunnelPort = 153 Integer.parseInt(tunnel.substring(colon+1).trim()); 154 } 155 catch (NumberFormatException e) { 156 Log.error(e); 157 tunnelHost = null; 158 tunnelPort = -1; 159 } 160 } 161 } 162 Log.debug("setTunnel host = |" + tunnelHost + "| port = " + tunnelPort); 163 } 164 142 165 public synchronized final long getLastErrorMillis() 143 166 { … … 200 223 socket = null; 201 224 errorText = null; 202 SocketConnection sc = 203 new SocketConnection(host, port, 30000, 200, null); 204 Log.debug("connecting to " + host + " on port " + port); 225 final String h; // Host. 226 final int p; // Port. 227 if (tunnelHost != null && tunnelPort > 0) { 228 h = tunnelHost; 229 p = tunnelPort; 230 Log.debug("connect using tunnel h = " + h + " p = " + p); 231 } else { 232 h = host; 233 p = port; 234 } 235 SocketConnection sc = new SocketConnection(h, p, 30000, 200, null); 236 Log.debug("connecting to " + h + " on port " + p); 205 237 socket = sc.connect(); 206 238 if (socket == null) {
Note: See TracChangeset
for help on using the changeset viewer.