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 internal_poll() call_out-loop. 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():