def close(self):
if not self.active:<EOL><INDENT>return<EOL><DEDENT>self.stop_thread()<EOL>for chan in list(self._channels.values()):<EOL><INDENT>chan._unlink()<EOL><DEDENT>self.sock.close()<EOL>
Close this session, and any open channels that are tied to it.