how to send data with twisted protocol via factory
问题 I'm writing a client implementing a custom protocol, and have a factory for it. My problem is the following: my client has bi-dir communication, and sometimes I want to tell it "send this data". But all I have is the factory object: class MyFactory(ClientFactory): protocol = MyProtocol def __init__(self, recv_callback): self.recv_callback = recv_callback def send_message(self, msg): self.protocol.send_message(msg) So I create a factory and have a factory object, I don't the protocol object.