detect detached socket