title: Twisted - how to create multi protocol process and send the data between the protocols
body: <p>Im trying to write a program that would be listening for data (simple text messages) on some port (say tcp 6666) and then pass them to one or more different protocols - irc, xmpp and so on. I've tried many approaches and digged the Internet, but I cant find easy and working solution for such task.</p>
  
  <p>The code I am currently fighting with is here: <a href="http://pastebin.com/ri7caXih" rel="nofollow noreferrer">http://pastebin.com/ri7caXih</a></p>
  
  <p>I would like to know how to from object like:</p>
  
  <p>ircf = ircFactory('asdfasdf', '#asdf666')</p>
  
  <p>get access to self protocol methods, because this:</p>
  
  <p>self.protocol.dupa1(msg)</p>
  
  <p>returns error about self not being passed to active protocol object. Or maybe there is other, better, easier and more kosher way to create single reactor with multiple protocols and have actions triggeres when a message arrives on any of them, and then pass that message to other protocols for handling/processing/sending?</p>
  
  <p>Any help will be highly appreciated!</p>