mirror of
https://github.com/xcat2/confluent.git
synced 2026-01-11 18:42:29 +00:00
Have socket api gracefully handle client disconnect
When client disconnected, an unsightly trace was incurred. Properly handle that particular scenario and proceed as intended.
This commit is contained in:
@@ -27,6 +27,8 @@ def send_tlvdata(handle, data):
|
||||
|
||||
def recv_tlvdata(handle):
|
||||
tl = handle.recv(4)
|
||||
if len(tl) == 0:
|
||||
return None
|
||||
tl = struct.unpack("!I", tl)[0]
|
||||
if tl & 0b10000000000000000000000000000000:
|
||||
raise Exception("Protocol Violation, reserved bit set")
|
||||
|
||||
Reference in New Issue
Block a user