mirror of https://github.com/joan2937/pigpio
Fix pigpio socket loop when connection closes
This commit is contained in:
parent
c33738a320
commit
01f34faef6
|
@ -1194,8 +1194,10 @@ class _callback_thread(threading.Thread):
|
||||||
while self.go:
|
while self.go:
|
||||||
|
|
||||||
buf += self.sl.s.recv(RECV_SIZ)
|
buf += self.sl.s.recv(RECV_SIZ)
|
||||||
offset = 0
|
if len(buf) == 0:
|
||||||
|
self.stop()
|
||||||
|
|
||||||
|
offset = 0
|
||||||
while self.go and (len(buf) - offset) >= MSG_SIZ:
|
while self.go and (len(buf) - offset) >= MSG_SIZ:
|
||||||
msgbuf = buf[offset:offset + MSG_SIZ]
|
msgbuf = buf[offset:offset + MSG_SIZ]
|
||||||
offset += MSG_SIZ
|
offset += MSG_SIZ
|
||||||
|
|
Loading…
Reference in New Issue