|
|
@ -3,8 +3,6 @@
|
|
|
|
# Test whether a CONNECT with reserved set to 1 results in a disconnect. MQTT-3.1.2-3
|
|
|
|
# Test whether a CONNECT with reserved set to 1 results in a disconnect. MQTT-3.1.2-3
|
|
|
|
|
|
|
|
|
|
|
|
from mosq_test_helper import *
|
|
|
|
from mosq_test_helper import *
|
|
|
|
from socket import error as SocketError
|
|
|
|
|
|
|
|
import errno
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rc = 1
|
|
|
|
rc = 1
|
|
|
|
keepalive = 10
|
|
|
|
keepalive = 10
|
|
|
@ -17,10 +15,9 @@ try:
|
|
|
|
sock = mosq_test.do_client_connect(connect_packet, b"", port=port)
|
|
|
|
sock = mosq_test.do_client_connect(connect_packet, b"", port=port)
|
|
|
|
sock.close()
|
|
|
|
sock.close()
|
|
|
|
rc = 0
|
|
|
|
rc = 0
|
|
|
|
except SocketError as e:
|
|
|
|
except socket.error as e:
|
|
|
|
if e.errno == errno.ECONNRESET:
|
|
|
|
if e.errno == errno.ECONNRESET:
|
|
|
|
# Connection has been closed by peer (very quickly).
|
|
|
|
# Connection has been closed by peer, this is the expected behaviour
|
|
|
|
# Fine, this is the expected behavior.
|
|
|
|
|
|
|
|
rc = 0
|
|
|
|
rc = 0
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
broker.terminate()
|
|
|
|
broker.terminate()
|
|
|
|