···192192`close` takes an optional value where you can specify the `code` and/or `reason`: `conn.close(.{.code = 4000, .reason = "bye bye"})` Refer to [RFC6455](https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1) for valid codes. The `reason` must be <= 123 bytes.
193193194194### Writer
195195-It's possible to get a `std.io.Writer` from a `*Conn`. Because websocket messages are framed, the writter will buffer the message in memory and requires an explicit "flush". Buffering requires an allocator.
195195+It's possible to get a `*std.Io.Writer` from a `*Conn`. Because websocket messages are framed, the writter will buffer the message in memory and requires an explicit "send". Buffering requires an allocator.
196196197197```zig
198198// .text or .binary
199199var wb = conn.writeBuffer(allocator, .text);
200200defer wb.deinit();
201201-try std.fmt.format(wb.writer(), "it's over {d}!!!", .{9000});
202202-try wb.flush();
201201+try wb.interface.print("it's over {d}!!!", .{9000});
202202+try wb.send();
203203```
204204205205Consider using the `clientMessage` overload which accepts an allocator. Not only is this allocator fast (it's a thread-local buffer than fallsback to an arena), but it also eliminates the need to call `deinit`:
···211211212212 var wb = conn.writeBuffer(allocator, .text);
213213 try std.fmt.format(wb.writer(), "it's over {d}!!!", .{9000});
214214- try wb.flush();
214214+ try wb.send();
215215}
216216```
217217···340340 // is freed after each message.
341341 // true = more memory, but fewer allocations
342342 retain_write_buffer: bool = true,
343343-344344- // Advanced options that are part of the permessage-deflate specification.
345345- // You can set these to true to try and save a bit of memory. But if you
346346- // want to save memory, don't use compression at all.
347347- client_no_context_takeover: bool = false,
348348- server_no_context_takeover: bool = false,
349343 };
350344}
351345```