twisted

Python: deferToThread XMLRPC Server - Twisted - Cherrypy?

This question is related to others I have asked on here, mainly regarding sorting huge sets of data in memory. Basically this is what I want / have: Twisted XMLRPC server running. This server keeps several (32) instances of Foo class in memory. Each Foo class contains a list bar (which will contain several million records). There is...

Threads in twisted... how to use them properly?

I need to write a simple app that runs two threads: - thread 1: runs at timed periods, let's say every 1 minute - thread 2: just a 'normal' while True loop that does 'stuff' if not the requirement to run at timed interval I would have not looked at twisted at all, but simple sleep(60) is not good enough and construction like: l = task....

equivalent ruby library as python's twisted?

Is there an equivalent to Python's Twisted available in Ruby to abstract common networking protocols and make dealing with TCP/IP sockets generally easier? ...

Python Jabber/XMPP client library for Twisted

I am looking for a Python library for writing Jabber/XMPP clients using the Twisted framework. ...

py2exe twisted outcoming udp packet

Hi all, I've developed an application for Windows that use wxPython and twisted. The issue is that if I run the app using the Python interpreter everything is OK (I could receive and transmit UDP packets). If I build a py2exe app I can only receive UDP packets. I have no error, the app is responsive but tx packets are not transmitted ...

twisted.web2 and spawining threads for synchronous code?

So, I'm writing a python web application using the twisted web2 framework. There's a library that I need to use (SQLAlchemy, to be specific) that doesn't have asynchronous code. Would it be bad to spawn a thread to handle the request, fetch any data from the DB, and then return a response? I'm afraid that if there was a flood of requests...

How to init twisted reactor in the right way?

hi, i have a class MyJabber which init a basic jabber account that print the incoming messages to stdout + put them into a queue. The code that add the client to the reactor is this: def addReactor(self): print 'inside AddReactor' factory = client.basicClientFactory(self.jid, self.option['jabber']['password']) print "factory initiali...

How do I get my simple twisted proxy to work?

I am attempting to make use of the Twisted.Web framework. Notice the three line comments (#line1, #line2, #line3). I want to create a proxy (gateway?) that will forward a request to one of two servers depending on the url. If I uncomment either comment 1 or 2 (and comment the rest), the request is proxied to the correct server. However,...

Question regarding UDP communication in twisted framework

I would like to find out if Twisted imposes restriction on maximum size of UDP packets. The allowable limit on linux platforms is upto 64k (although I intend to send packets of about 10k bytes consisting of JPEG images) but I am not able to send more than approx. 2500 bytes ...

simple twisted server (twistd .tap)with a pexpect instance error

Hi all, I have been creating an async server socket that sends and recives xml using twisted. The application works great! but because my main objective was to embed it in an init.d script and make it run in the background i decided to transform it in a "twisted application" in order to run it using twistd # from twisted.internet impor...

twisted matrix framework for java

is there a twisted matrix framework for java?? ...

python twisted stdio multiple connections to a server with a command prompt for interaction

Hi, I have written a simple twisted application that connects to a server that listens on 1 or more ports. The twisted app connects to this server and usually connects to a few of the open ports at a time. This server is a serial logger that connects to serial devices and provides the serial line information through a raw TCP Socket an...

How to get the original TCP connection hostname in Python Twisted?

With Twisted's TCP mechanisms, when a protocol is created, the only information about the peer is its IP address and port. How can I retrieve the original hostname that I tried to connect with? reactor.connectTCP('somehost.com', 80, MyFactory) How can I ever get 'somehost.com' through a callback somehow? In other words, connectTCP ret...

twisted connectTCP memory leak?

I found my program have a memory leak when I used connectTCP. <class 'twisted.internet.tcp.Client'> <<class 'twisted.internet.tcp.Client'> to ('10.25.76.117', 8086) at 2066c5b0> <type 'dict'> {'_tempDataBuffer': [], 'protocol': None, '_tempDataLen': 0, 'realAddress': ('10 <type 'tuple'> ('10.25.76.117', 8086) <type 'list'> ...

Why doesnt my php script work

All I want to do (initially) is the following: <?php phpinfo(); ?> I have two different web servers running. If I try to open the above in firefox, Under any filename, with the :80 port from apache, it merely echoes the above. If I try to open the above, as any filename, from a python twisted web server on port :8888, I get a http 5...

Best way to schedule a task to run in next iteration of a Twisted reactor loop.

I want to schedule a task to run in the next iteration of the reactor loop. What's the best way to do it? reactor.callLater(0, ...)? ...

Twisted connectionLost Event

Hey there, I use the twisted.words.protocols.jabber.client.XMPPClientFactory . Do you know how I can callback a function when the connection gets lost (for example WiFi-connection is down)? thank you for your help! ...

Why can't a Deferred be passed to a callback in Python Twisted?

d = Deferred() d.callback(Deferred()) # Assertion error saying that a Deferred shouldn't be passed Why is this? I looked through the code and commit messages / Trac and see no reason why this should be the case. The most obvious way to bypass this is to put the Deferred in a tuple, but why is this restriction here in the first place? ...

Security error on attempted access to twisted rpc server from javascript in the same domain but served from different port

Hi, I have a django server that serves the basic site with user, auth etc and a twisted web server that 'should' deliver live content as json streams. Django server is running on 127.0.0.1:8080 Twisted 127.0.0.1:9897 The problem is that when ever I try to make an http request to twisted server from a page in the django site, I get a ...

Accessing a ServerFactory from the Service in Twisted.

Hello All, I've been trying to come up with a decent design for multiple factories access each others information. For example, I have the following services: 1 management web service, a VirtualHost instance (multiple domains) and a built in DNS service. Going through the finger tutorial was very helpful but it lacks some key points. It ...