commit
5cc2951f46
2 changed files with 4 additions and 3 deletions
|
@ -178,7 +178,7 @@ class CoAP(object):
|
||||||
if opt.value == 26:
|
if opt.value == 26:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self._receiver_thread is None or not self._receiver_thread.isAlive():
|
if self._receiver_thread is None or not self._receiver_thread.is_alive():
|
||||||
self._receiver_thread = threading.Thread(target=self.receive_datagram)
|
self._receiver_thread = threading.Thread(target=self.receive_datagram)
|
||||||
self._receiver_thread.daemon = True
|
self._receiver_thread.daemon = True
|
||||||
self._receiver_thread.start()
|
self._receiver_thread.start()
|
||||||
|
|
|
@ -127,7 +127,7 @@ class Message(object):
|
||||||
self._token = value
|
self._token = value
|
||||||
return
|
return
|
||||||
if not isinstance(value, bytes):
|
if not isinstance(value, bytes):
|
||||||
value = bytes(value)
|
value = bytes(value, 'utf-8')
|
||||||
|
|
||||||
if len(value) > 256:
|
if len(value) > 256:
|
||||||
raise AttributeError
|
raise AttributeError
|
||||||
|
@ -646,6 +646,7 @@ class Message(object):
|
||||||
"""
|
"""
|
||||||
self.del_option_by_number(defines.OptionRegistry.BLOCK2.number)
|
self.del_option_by_number(defines.OptionRegistry.BLOCK2.number)
|
||||||
|
|
||||||
|
@property
|
||||||
def size1(self):
|
def size1(self):
|
||||||
value = None
|
value = None
|
||||||
for option in self.options:
|
for option in self.options:
|
||||||
|
|
Loading…
Reference in a new issue