[Twisted-Python] SNMP in Twisted

Christopher Armstrong radix at twistedmatrix.com
Wed May 28 05:45:02 EDT 2003


On 2003.05.28 05:41, Wari Wahab wrote:
> Andrew Bennetts wrote:
> 
> >Have you seen
> >    http://twistedmatrix.com/pipermail/twisted-python/2002-December/002456.html
> >
> OMG! That answer one half of my question, thanks. Should of probe around 
> first.
> 
> >(In general, the best approach to Twistifying a protocol in another Python
> >library is to reuse the message decoding and encoding, but use Twisted to
> >handle all the networking.  This usually means writing a Protocol subclass
> >that delegates most of the work in dataReceived to the library, but
> >obivously this depends on the protocol...)
> >  
> >
> So do you mean that twisted is the one sending out bytes to and from the 
> network, and pass dataReceived to the library?
> 
> This depends if the library has the encode and decode routines right? If 
> the library does it's own networking, then I cannot do it this way, am I 
> right in saying that?

Not really - the lib might do its own networking, but it'll often have,
as moshez put it, semi-internal methods for doing decoding and encoding.
You just need to bypass its network-using layer.

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/




More information about the Twisted-Python mailing list