import java.util.regex.Pattern;
-public class Processer implements Runnable {
+public class Processer implements Runnable, ResultNotify {
private Socket client;
//Conform status.
client = null;
} catch (IOException e) {
System.err.println("Execption occurred in Processer.");
+ //TODO: Display error Dialog.
e.printStackTrace();
} finally {
//for failsafe Socket close.
//IGNORE close Exception
}
}
+ //LDAP Connection close.
+ LDAPSearch.close();
}
}
while (true) {
line = clientReader.readLine();
+ if (line == null) {
+ //Finish client stream.
+ System.err.println("Client disconnected.");
+ break; //force disconnect.
+ }
+
if (isRcptTo(line)) {
//stored To: address.
toList.add(formatToAddress(line));
}
//checkout toList
- new ToListDialog(this, toList);
+ new ToListUI(this, toList);
while (result == RESULT_UNKNOWN) {
try {
}
}
- if (result == RESULT_NG) {
+ if (result != RESULT_OK ) {
System.out.println("CANCEL sending mail.");
serverWriter.println(COMMAND_RESET);
line = serverReader.readLine(); //Server MUST retrun "250 OK"
break; // client read while(true);
}
+ if (line == null ) {
+ break;
+ }
serverWriter.println(line);
System.out.println(line);
}