MCPcopy Create free account
hub / github.com/apache/httpd / client_close

Method client_close

test/pyhttpd/ws_util.py:87–94  ·  view source on GitHub ↗
(cls, code: int, reason: str = None,
                     mask: bytes = None)

Source from the content-addressed store, hash-verified

85
86 @classmethod
87 def client_close(cls, code: int, reason: str = None,
88 mask: bytes = None) -> 'WsFrame':
89 data = bytearray(struct.pack("!H", code))
90 if reason is not None:
91 data.extend(reason.encode())
92 if mask is None:
93 mask = bytes.fromhex('00 00 00 00')
94 return WsFrame(opcode=WsFrame.CLOSE, fin=True, mask=mask, data=data)
95
96
97class WsFrameReader:

Callers 1

ws_runFunction · 0.80

Calls 1

WsFrameClass · 0.85

Tested by 1

ws_runFunction · 0.64