Workaround to detect dead sockets.