Delete some self.socket,clean tab indent and add logger