Connection class started and enhance cancel discovery and socket closing method