bugfix:  no need to manually call the close method when keepalive failed