Changed Server to new protocol on port 9999 with only one String based
communication exchange
This commit is contained in:
@@ -15,7 +15,6 @@ implements Runnable {
|
||||
this.PORT = port;
|
||||
}
|
||||
|
||||
boolean updateNeeded = true;
|
||||
ServerSocket ses;
|
||||
Socket s;
|
||||
DataOutputStream out;
|
||||
@@ -25,25 +24,14 @@ implements Runnable {
|
||||
do {
|
||||
try {
|
||||
do {
|
||||
updateNeeded = true;
|
||||
ses = new ServerSocket(this.PORT);
|
||||
s = ses.accept();
|
||||
System.out.println("Connected with: " + s.getInetAddress());
|
||||
out = new DataOutputStream(s.getOutputStream());
|
||||
in = new DataInputStream(s.getInputStream());
|
||||
out.writeFloat(Start.version);
|
||||
System.out.println(in.readUTF());
|
||||
out.writeUTF("VERSION="+Start.version);
|
||||
|
||||
System.out.println(in.readUTF());
|
||||
System.out.println(in.readUTF());
|
||||
System.out.println(in.readUTF());
|
||||
System.out.println(in.readUTF());
|
||||
|
||||
updateNeeded = in.readBoolean();
|
||||
|
||||
if (updateNeeded) {
|
||||
System.out.println("Update needed, Download link was send");
|
||||
out.writeUTF(Start.download);
|
||||
}
|
||||
out.close();
|
||||
in.close();
|
||||
s.close();
|
||||
|
||||
@@ -6,7 +6,6 @@ import run.UpdateThread;
|
||||
|
||||
public class Start {
|
||||
public static float version = -1.0f;
|
||||
public static String download = "";
|
||||
|
||||
private static final int PORT = 9999;
|
||||
|
||||
@@ -14,7 +13,6 @@ public class Start {
|
||||
public static void main(String[] args) {
|
||||
|
||||
version = Float.parseFloat(JOptionPane.showInputDialog("QuickLaunch version:"));
|
||||
download = JOptionPane.showInputDialog("Link to downloadable");
|
||||
Thread ut = new Thread(new UpdateThread());
|
||||
ut.start();
|
||||
System.out.println("Update thread started");
|
||||
|
||||
@@ -9,7 +9,6 @@ implements Runnable {
|
||||
public void run() {
|
||||
do {
|
||||
Start.version = Float.parseFloat(JOptionPane.showInputDialog("QuickLaunch version (" + Start.version + "): "));
|
||||
Start.download = JOptionPane.showInputDialog("Link to downloadable:");
|
||||
} while (true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user