Set an active command before establishing a connection.

Otherwise the disconnect thread will close the connection
due to inactivity. We could add a variable 'isConnecting',
but I'm not sure if adding another (ruffy-) global state
variable will make things simpler to grasp.
This commit is contained in:
Johannes Mockenhaupt 2017-07-17 18:04:55 +02:00
parent c37310685a
commit 02a9ed6eda
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -170,10 +170,9 @@ public class RuffyScripter {
synchronized (RuffyScripter.class) {
try {
ensureConnected();
final RuffyScripter scripter = this;
activeCmd = cmd;
ensureConnected();
final RuffyScripter scripter = this;
final Returnable returnable = new Returnable();
Thread cmdThread = new Thread(new Runnable() {
@Override