change self._socket to self.socket