Closes the connection, sending a graceful teardown message to the other side. If you provide no arguments, it sends code 1000, normal closure. If you provide a code, you should also provide a short reason string.
foundational
See Implementation
The default code was changed to 1000 on January 9, 2023. Previously it was 0, but also ignored anyway.
On May 11, 2024, the optional arguments were changed to overloads since if you provide a code, you should also provide a reason.
Closes the connection, sending a graceful teardown message to the other side. If you provide no arguments, it sends code 1000, normal closure. If you provide a code, you should also provide a short reason string.