|
|
|
|
|
|
|
|
protected ObjectOutputStream writer; |
|
|
protected ObjectOutputStream writer; |
|
|
|
|
|
|
|
|
private Figur figur; |
|
|
private Figur figur; |
|
|
private String txtNachricht; |
|
|
|
|
|
private boolean laufend; |
|
|
|
|
|
private SubmissionPublisher<Figur> figurPublisher; |
|
|
private SubmissionPublisher<Figur> figurPublisher; |
|
|
private ExecutorService eService; |
|
|
private ExecutorService eService; |
|
|
private String receivedString; |
|
|
private String receivedString; |
|
|
|
|
|
|
|
|
public void run() { |
|
|
public void run() { |
|
|
while (true) { |
|
|
while (true) { |
|
|
lg.info("Warte auf Nachricht"); |
|
|
lg.info("Warte auf Nachricht"); |
|
|
if(laufend) { |
|
|
|
|
|
figur = receive(); |
|
|
|
|
|
|
|
|
figur = receive(); |
|
|
if(!figur.getPunkte().isEmpty()){ |
|
|
if(!figur.getPunkte().isEmpty()){ |
|
|
figurPublisher.submit(figur); |
|
|
figurPublisher.submit(figur); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void startempfangen() |
|
|
private void startempfangen() |
|
|
{ |
|
|
{ |
|
|
synchronized (this){ |
|
|
synchronized (this){ |
|
|
laufend = true; |
|
|
|
|
|
} |
|
|
} |
|
|
if (eService == null){ |
|
|
if (eService == null){ |
|
|
eService = Executors.newSingleThreadExecutor(); |
|
|
eService = Executors.newSingleThreadExecutor(); |