close connection if nread <= 0