|
|
@@ -27,7 +27,7 @@ public class Transmitter extends Observable implements Runnable |
|
|
|
{ |
|
|
|
private static final Logger lg = OhmLogger.getLogger(); |
|
|
|
private static final int PORT = 35000; |
|
|
|
private String IP_ADRESSE = "127.0.0.1"; |
|
|
|
private String IP_ADRESSE = ""; |
|
|
|
|
|
|
|
int modus; |
|
|
|
private String nachricht; |
|
|
@@ -56,7 +56,13 @@ public class Transmitter extends Observable implements Runnable |
|
|
|
{ |
|
|
|
sSocket = new ServerSocket(PORT); |
|
|
|
lg.info("Server: Warte auf Verbindung ..."); |
|
|
|
nachricht = "Server: Warte auf Verbindung ..."; |
|
|
|
setChanged(); |
|
|
|
notifyObservers(); |
|
|
|
s = sSocket.accept(); // Achtung: blockiert! |
|
|
|
nachricht = "Verbunden mit Client"; |
|
|
|
setChanged(); |
|
|
|
notifyObservers(); |
|
|
|
lg.info("Server: Verbindung akzeptiert"); |
|
|
|
} |
|
|
|
catch (IOException ex) |
|
|
@@ -65,7 +71,10 @@ public class Transmitter extends Observable implements Runnable |
|
|
|
} |
|
|
|
} |
|
|
|
else if (modus == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
nachricht = "Verbinden mit "+ IP_ADRESSE; |
|
|
|
setChanged(); |
|
|
|
notifyObservers(); |
|
|
|
lg.info("Client: verbinde ..."); |
|
|
|
try |
|
|
|
{ |