mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
send LWT on release builds too
This commit is contained in:
parent
d9b1fb4df6
commit
25c85af2e6
1 changed files with 5 additions and 7 deletions
|
@ -271,9 +271,8 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba
|
|||
|
||||
// Last Will and Testimate is the way I can get the server notified of a
|
||||
// closed connection.
|
||||
private void addLWTIf( MqttConnectOptions mqttConnectOptions )
|
||||
private void addLWT( MqttConnectOptions mqttConnectOptions )
|
||||
{
|
||||
if ( BuildConfig.DEBUG ) {
|
||||
try {
|
||||
JSONObject payload = new JSONObject();
|
||||
payload.put( "devid", mDevID );
|
||||
|
@ -282,8 +281,7 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba
|
|||
|
||||
// mqttConnectOptions.setKeepAliveInterval( 15 ); // seconds; for testing
|
||||
} catch ( JSONException je ) {
|
||||
Log.e( TAG, "addLWTIf() ex: %s", je );
|
||||
}
|
||||
Log.e( TAG, "addLWT() ex: %s", je );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,7 +293,7 @@ public class MQTTUtils extends Thread implements IMqttActionListener, MqttCallba
|
|||
mqttConnectOptions.setCleanSession(false);
|
||||
mqttConnectOptions.setUserName("xwuser");
|
||||
mqttConnectOptions.setPassword("xw4r0cks".toCharArray());
|
||||
addLWTIf( mqttConnectOptions );
|
||||
addLWT( mqttConnectOptions );
|
||||
|
||||
try {
|
||||
setState( State.CONNECTING );
|
||||
|
|
Loading…
Add table
Reference in a new issue