public static final int DIALOG = 5;
public static final int INIT1 = 6;
public static final int SENDPIN = 7;
+ public static final int CONFIRMLOGIN = 8;
int oldstate = INIT;
int state = INIT;
int nextstate = INIT;
case SENDLOGIN:
applet.showLoginDiag();
break;
+ case CONFIRMLOGIN:
+ applet.showLoginConfirmDiag();
+ break;
case SENDPASSWD:
applet.showPassDiag();
break;
applet.showMessage("Connecting to Server...");
try {
String host;
+ int port;
if (applet.isStandalone) {
+ port = 9001;
host = (System.getProperties()).getProperty("host", "");
if (host == null || host.equals("")) {
System.err.println("Cannot learn host name (application) using localhost");
} else {
URL cb = applet.getCodeBase();
String protocol = cb.getProtocol();
+ port = 443; // Use https port for firewall traversal.
if (protocol.equals("file") || protocol.equals("FILE")) {
System.err.println("Applet: FILE protocol in use, connecting to localhost");
host = "localhost";
host = cb.getHost();
}
}
- sock = new Socket(host, 9001);
+ sock = new Socket(host, port);
} catch (Exception e) {
e.printStackTrace();
applet.showError1(true);
applet.showMessage("Please wait...");
send.SendLogin(applet.LoginName.getText());
break;
+ case CONFIRMLOGIN:
+ applet.showMessage("Please wait...");
+ send.ConfirmLogin(applet.chosenlogin);
+ break;
case SENDPASSWD:
if (!(applet.Password1.getText().equals(applet.Password2.getText()))) {
applet.Password1.setText("");