avoid InputStream is already closed when disconnect