MCPcopy Create free account
hub / github.com/aio-libs/aiohttp / build_close_frame

Function build_close_frame

tests/test_websocket_parser.py:98–104  ·  view source on GitHub ↗
(code=1000, message=b"", noheader=False)

Source from the content-addressed store, hash-verified

96
97
98def build_close_frame(code=1000, message=b"", noheader=False):
99 # Close the websocket, sending the specified code and message.
100 if isinstance(message, str): # pragma: no cover
101 message = message.encode("utf-8")
102 return build_frame(
103 PACK_CLOSE_CODE(code) + message, opcode=WSMsgType.CLOSE, noheader=noheader
104 )
105
106
107@pytest.fixture()

Calls 2

build_frameFunction · 0.85
encodeMethod · 0.80

Tested by

no test coverage detected