[Twisted-Python] Re: Using compiled C Library with Twisted?
![](https://secure.gravatar.com/avatar/3a7e70f3ef2ad1539da42afc85c8d09d.jpg?s=120&d=mm&r=g)
This message is more appropriate for twisted-python@twistedmatrix.com, not twisted-web@twistedmatrix.com.
-------- Original Message -------- Subject: [Twisted-web] Using compiled C Library with Twisted? From: Jiannan Fu <jf@ypsilon.net> To: twisted-web@twistedmatrix.com
hi there, i got the following problem: I have a set of compiled C files, providing a API for a special encryption / decrytion of messages to be exchanged over the internet, well documented and with a lot of programming examples of how to work with it and its functions (in this case the examples are all in C). Now i want to use it with twisted together, to have all the advantages of twisted (especially the reactor instead of threading, deferred and so on), but the C API to do the last step before messages are send out.
The C API should just play some kind of middleware between the tcp-ip protokoll and the twisted server. Is it possible to extending twisted with that library by "just import" them?
Any kind of advice / suggestions would help
You don't have to do anything special to get C libraries to work with Twisted; you'll have to create a Python-C binding for them, of course, and then you just import the binding and call the functions in it. Just call out to these functions to decode and encode chunks of data when you receive or send it. From the info you provided, that's all the advice I can come up with. -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://radix.twistedmatrix.com/
participants (1)
-
Christopher Armstrong