def doUnsubscribe(self, request):
request.msgId = self.factory.makeId()<EOL>if isinstance(request.topics, str):<EOL><INDENT>request.topics = [request.topics]<EOL><DEDENT>try:<EOL><INDENT>self._checkUnsubscribe(request)<EOL>request.msgId = self.factory.makeId()<EOL>request.encode() <EOL><DEDENT>except Exception as e:<EOL><INDENT>return defer.fail(e)<EOL><DEDENT>request.interval = Interval(initial=self._initialT)<EOL>request.deferred = defer.Deferred()<EOL>request.deferred.msgId = request.msgId<EOL>self.factory.windowUnsubscribe[self.addr][request.msgId] = request<EOL>self._retryUnsubscribe(request, dup=False)<EOL>return  request.deferred<EOL>
Send an UNSUBSCRIBE control packet