@@ -723,13 +723,13 @@ class WebSocket(object):
|
|||||||
return ABNF(fin, rsv1, rsv2, rsv3, opcode, has_mask, payload)
|
return ABNF(fin, rsv1, rsv2, rsv3, opcode, has_mask, payload)
|
||||||
|
|
||||||
|
|
||||||
def send_close(self, status=STATUS_NORMAL, reason=""):
|
def send_close(self, status=STATUS_NORMAL, reason=b""):
|
||||||
"""
|
"""
|
||||||
send close data to the server.
|
send close data to the server.
|
||||||
|
|
||||||
status: status code to send. see STATUS_XXX.
|
status: status code to send. see STATUS_XXX.
|
||||||
|
|
||||||
reason: the reason to close. This must be string.
|
reason: the reason to close. This must be string or bytes.
|
||||||
"""
|
"""
|
||||||
if status < 0 or status >= ABNF.LENGTH_16:
|
if status < 0 or status >= ABNF.LENGTH_16:
|
||||||
raise ValueError("code is invalid range")
|
raise ValueError("code is invalid range")
|
||||||
|
Reference in New Issue
Block a user