Re: Multi-threaded SSL

Discussion in 'Python' started by Jean-Paul Calderone, Feb 18, 2006.

  1. On 17 Feb 2006 23:37:22 -0800, wrote:
    >Thanks Alex. I hadn't noticed that example. I gave it a shot and
    >still have the synchronization problems. While this may be because of
    >a lack of understanding of twisted threads (again, perhaps I'm just not
    >looking in the right places, but even the the API reference is sparse
    >of explanation), I strongly suspect that there's something going on at
    >a lower level, like the Open SSL wrapper or Open SSL on the system
    >level.


    You probably couldn't find an explanation of Twisted threads due to the fact that Twisted is implemented almost exclusively without using threads at all. Aside from the large library of protocol implementations, this is one of its main selling points. ;)

    >At this point, I'd just like to know if I should cut my losses
    >and try a very rapid polling solution (*cringes*). Here are my
    >attempts:
    >
    >Twisted SSL Foray:
    >http://cixar.com/svn/mage/twisted_ssl_foray.py
    >http://cixar.com/websvn/filedetails.php?repname=Cixar&path=/mage/twisted_ssl_foray.py&rev=0&sc=0


    After reading my comment above, hopefully it is clear what is awry in this code. You cannot use sleep() in a Twisted application and expect anything to work well. Instead, a scheduling primitive is provided, reactor.callLater(delay, function[, *a[, **kw]]).

    However, rather than using the low-level APIs of twisted.web directly, you may be interested in using an implementation of this idea which already exists. Take a look at <http://divmod.org/trac/wiki/DivmodNevow/Athena>. The tutorial builds up a web page which does something very like what your code seems to be attempting.

    If you pursue the Twisted version, keep in mind the web-dedicated Twisted mailing list you can use as a resource: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web>.

    Jean-Paul
     
    Jean-Paul Calderone, Feb 18, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David
    Replies:
    0
    Views:
    545
    David
    Sep 24, 2003
  2. GWiz

    Multi-threaded HTTP Module

    GWiz, Oct 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    754
    John Timney \( MVP \)
    Oct 16, 2005
  3. Danny Woods
    Replies:
    7
    Views:
    1,994
    Tim Ward
    Oct 14, 2003
  4. Kris Kowal

    Multi-threaded SSL

    Kris Kowal, Feb 18, 2006, in forum: Python
    Replies:
    3
    Views:
    737
    Heikki Toivonen
    Feb 22, 2006
  5. ian douglas
    Replies:
    2
    Views:
    988
    Randy Howard
    Jul 30, 2004
Loading...

Share This Page