def thread_protocol(self): """ Protocol instance corresponding to the current thread. Not intended to be called from connection thread. """ return self.protocols[get_ident()]