Exit on timeout when receiving

- Could be made optional in the future
- Sending messages while receiving results in damaged session state
  because both save their own state
This commit is contained in:
AsamK 2015-07-08 11:52:06 +02:00
parent bd485ec9f7
commit 704f2d76ba
2 changed files with 6 additions and 3 deletions

View file

@ -186,7 +186,7 @@ public class Main {
System.exit(1);
}
try {
m.receiveMessages(new Manager.ReceiveMessageHandler() {
m.receiveMessages(5, true, new Manager.ReceiveMessageHandler() {
@Override
public void handleMessage(TextSecureEnvelope envelope) {
System.out.println("Envelope from: " + envelope.getSource());
@ -233,5 +233,6 @@ public class Main {
break;
}
m.save();
System.exit(0);
}
}