Browse Source

Funktioniert und aufgeräumt

Jens
Jens Schuhmann 1 year ago
parent
commit
68eb43c715
2 changed files with 3 additions and 11 deletions
  1. 1
    9
      src/ChatProgramm/model/Transmitter.java
  2. 2
    2
      src/config.properties

+ 1
- 9
src/ChatProgramm/model/Transmitter.java View File

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();

+ 2
- 2
src/config.properties View File

log.level=INFO log.level=INFO


log.directory=../Aufgabe7_bandit
log.filename=ohmLog
# log.directory=../Aufgabe7_bandit
# log.filename=ohmLog


# Beispiel f\u00fcr verschiedene Level f\u00fcr unterschiedliche Pakete # Beispiel f\u00fcr verschiedene Level f\u00fcr unterschiedliche Pakete
# log.level.bandit.Zahlengenerator=FINE # log.level.bandit.Zahlengenerator=FINE

Loading…
Cancel
Save