+ return websock_send(ws, 1, 0, 0, 0, OPCODE_CLOSE, NULL, 0);
+}
+
+int websock_close_code(struct websock *ws, uint16_t code, const void *data, size_t length)
+{
+ unsigned char buffer[125];
+
+ /* checks the length */
+ if (length > 123) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* prepare the buffer */