Exemple #1
0
 String register(String domain, String regno, String user, String pass) {
   int cmdID = commID++;
   this.domain = domain;
   connect(user, pass);
   try {
     out.println(cmdID + ";reg:" + regno + ":" + user + ":" + pass);
     out.flush();
     String rep = (String) receiveReply(cmdID);
     disconnect();
     return rep.split(":")[0];
   } catch (Exception r) {
     r.printStackTrace();
   }
   return null;
 }
Exemple #2
0
 /**
  * Disconnects the current client and socket connection, overwriting the connection settings to
  * the settings file
  */
 public static void disconnectClient() {
   if (client != null) {
     writeSettingsToFile();
     client.disconnect();
   }
 }