attempt to rotate the local backend once if no callbacks are installed. close(): Schedule a close packet, and block further calls to write. If both directions block also further calls to read. Install both ssl_write_callback and ssl_read_callback and rotate the local backend until connection closed from other end, or linger time expires.
Clear user callbacks and switch to nonblocking mode.
Attempt to send a close packet. Terminate the
ssl_read_callback(): Decode received data and add it to user_read_buffer. Schedule read_callback with real_backend call_out. Uninstall on user_read_buffer full. ssl_write_callback(): Send data from write_buffer, uninstall on write_buffer empty. Schedule write_callback with real_backend call_out. On send failure, block futher calls of write.