[Twisted-Python] thread + signal + reactor.stop problem

2009-02-13 Thread Gabriel Rossetti
Hello everyone, I was able to write a small example that reproduces my problem, when I redefine signal and I have threads and I try to stop the reactor, it hangs. I wasn't sure if it was loopingCall or callLater or threads at first, but from my tests it's the threads that cause the problem. I

Re: [Twisted-Python] SQLAlchemy and Twisted

2009-02-13 Thread Peter Cai
Hi, Thanks for this insightful comments on Sqlalchmy and Twisted. I hope I had read your mail before I start my current project. At that time, I simply thought using deferToThread would solve everything since the twisted.enterprise.adbapi simply use threads.deferToThreadPool to make database in

Re: [Twisted-Python] thread + signal + reactor.stop problem

2009-02-13 Thread Reza Lotun
Hi Gabriel, There's two problems from what I can see. 1) You have a method run in a thread def __myLoop(self): while True: self.transport.write("Thread") time.sleep(1) but since it's being run in a thread, you need to schedule the call into the reactor like s

Re: [Twisted-Python] thread + signal + reactor.stop problem

2009-02-13 Thread Gabriel Rossetti
Reza Lotun wrote: Hi Gabriel, Hello Reza, There's two problems from what I can see. 1) You have a method run in a thread def __myLoop(self): while True: self.transport.write("Thread") time.sleep(1) but since it's being run in a thread, you need to sched

[Twisted-Python] half-closing SSL connection, unexpected connectionLost() error

2009-02-13 Thread Denis Bilenko
Hi, What's the correct way to call loseWriteConnection on SSL connection? I keep getting "Connection was closed in a non-clean fashion" errors when I do that. Here's a minimal server and a client that trigger the error. Note that the server does not implement IHalfCloseableProtocol and I'd like t

[Twisted-Python] Slow Performance of Twisted Script

2009-02-13 Thread Thomas Greenwood
Hi everyone, I have been developing my first python script and jumped straight into the world of twisted. I like the concept but I seem to be doing something very wrong. The script takes an NZB file and parses it (using HellaNZB's parser) and then makes a specified number of connections to the new

Re: [Twisted-Python] half-closing SSL connection, unexpected connectionLost() error

2009-02-13 Thread glyph
On 02:35 pm, denis.bile...@gmail.com wrote: What's the correct way to call loseWriteConnection on SSL connection? It is illegal, according to the specification. http://tools.ietf.org/html/rfc4346#section-7.2.1 [upon receiving a close_notify] ... The other party MUST respond with a clos