MCPcopy Index your code
hub / github.com/python-websockets/websockets / serialize

Method serialize

src/websockets/frames.py:410–416  ·  view source on GitHub ↗

Serialize the payload of a close frame.

(self)

Source from the content-addressed store, hash-verified

408 raise ProtocolError("close frame too short")
409
410 def serialize(self) -> bytes:
411 """
412 Serialize the payload of a close frame.
413
414 """
415 self.check()
416 return struct.pack("!H", self.code) + self.reason.encode()
417
418 def check(self) -> None:
419 """

Callers 3

send_closeMethod · 0.95
failMethod · 0.95
fail_connectionMethod · 0.95

Calls 2

checkMethod · 0.95
encodeMethod · 0.45

Tested by

no test coverage detected