[Twisted-Python] Is this possible to catch this error? (returned by protocols/memcached.py)

2011-06-03 Thread Attila Nagy
Hi, Here's a sample application, which gets a key from memcached: from twisted.internet import reactor, protocol, defer from twisted.application import internet, service from twisted.protocols.memcache import MemCacheProtocol, DEFAULT_PORT mc = None class

Re: [Twisted-Python] Is this possible to catch this error? (returned by protocols/memcached.py)

2011-06-03 Thread Attila Nagy
Hi, On 06/03/11 15:57, exar...@twistedmatrix.com wrote: Using a global protocol instance like this is error prone. return p def memc(): factory = MemCacheFactory() reactor.connectTCP('localhost', 11211, factory) reactor.callLater(1,query) What if the connection isn't

Re: [Twisted-Python] What's the purpose of __?

2011-02-16 Thread Attila Nagy
On 02/15/2011 11:03 PM, Phil Christensen wrote: On Feb 15, 2011, at 5:36 AM, Attila Nagy wrote: Hi, I'm trying to do an LMTP implementation based on smtp.py and came to the issue of class private variables with double underscores. Examples: http://twistedmatrix.com/trac/browser/trunk

Re: [Twisted-Python] What's the purpose of __?

2011-02-16 Thread Attila Nagy
-underscore: http://docs.python.org/tutorial/classes.html#private-variables Jason On Tue, Feb 15, 2011 at 5:36 AM, Attila Nagy b...@fsn.hu mailto:b...@fsn.hu wrote: Hi, I'm trying to do an LMTP implementation based on smtp.py and came to the issue of class private variables with double

[Twisted-Python] What's the purpose of __?

2011-02-15 Thread Attila Nagy
Hi, I'm trying to do an LMTP implementation based on smtp.py and came to the issue of class private variables with double underscores. Examples: http://twistedmatrix.com/trac/browser/trunk/twisted/mail/smtp.py#L746 http://twistedmatrix.com/trac/browser/trunk/twisted/mail/smtp.py#L815 and a lot

Re: [Twisted-Python] Is AMP secure enough for the internet?

2010-03-01 Thread Attila Nagy
Eric P. Mangold wrote: AMP keys are limited to 256 bytes and values are limited to 64k. So that will prevent your program from handling a malformed AMP packet that tries to exceed those limits Yes, I know that from the docs, but I haven't read the code, and it's not trivial where this

[Twisted-Python] Is AMP secure enough for the internet?

2010-02-27 Thread Attila Nagy
Hello, I'm planning a data collector gateway and wondering whether Twisted's AMP would be good for the task. AMP seems to be a good fit for the job, but I'm not sure about the security. I make the client side too, but I won't operate it, bad guys can take over that side and I want to protect my

[Twisted-Python] Handling exceptions in twisted.internet.udp?

2010-02-08 Thread Attila Nagy
Hello, I have a code, which opens persistent (connected, see: http://twistedmatrix.com/documents/current/core/howto/udp.html#auto2) UDP connections, and sends and receives data on them. The problem is that occasionally I receive ICMP 13 (administratively prohibited) errors from the

Re: [Twisted-Python] Handling exceptions in twisted.internet.udp?

2010-02-08 Thread Attila Nagy
exar...@twistedmatrix.com wrote: [snip] /usr/lib64/python2.6/site-packages/Twisted-9.0.0_r27775-py2.6-linux- x86_64.egg/twisted/internet/udp.py, line 109, in doRead data, addr = self.socket.recvfrom(self.maxPacketSize) socket.error: [Errno 113] No route to host I wonder

[Twisted-Python] Processpool recommendation (for scaling to multiple CPUs)

2009-05-24 Thread Attila Nagy
Hello, Is there any efficient built-in machinery in twisted for running a (TCP, UDP or unix domain socket) service in a connection multiplexer-worker processes manner? Or if there isn't, what is the recommended way of doing this? (any examples maybe?) I've got some CPU scalability issues (the