[+] throw error if not connected and flush all on connection reset