Questions tagged [twisted.internet]

Twisted Internet: Asynchronous I/O and Events.

Twisted Internet is a collection of compatible event-loops for . It contains the code to dispatch events to interested observers and a portable API so that observers need not care about which event loop is running. Thus, it is possible to use the same code for different loops, from Twisted's basic, yet portable, select-based loop to the loops of various GUI toolkits like GTK+ or Tk.

Project and documentation: http://twistedmatrix.com/documents/current/api/twisted.internet.html

180 questions
3
votes
1 answer

iocpreactor release status in twisted

we are having issues with the default select reactor on Windows 2008. There is an alternative reactor, the iocpreactor, that looks like an ideal solution for Windows. it is listed in the documentation as experimental, and 'nearly ready'. What does…
2
votes
1 answer

Twisted non-blocking method - how to?

My code looks like this: ... # class Site(Resource) def render_POST(self,request) otherclass.doAssync(request.args) print '1' return "done" #that returns the HTTP response, always the same. ... def doAssync(self,msg): d =…
joaoricardo000
  • 4,764
  • 4
  • 25
  • 36
2
votes
0 answers

Twisted: How do I destroy a connection?

I keep a list of client connections which are setup like this: cons = {} sid = 5 cons[sid] = self.reactor.connectTCP(host, port, myprotocol) If the item is still connected, and I call del cons[5] , the connection object still persists. I can see…
Coder1
  • 13,139
  • 15
  • 59
  • 89
2
votes
1 answer

Twisted async request processing

How can I do async request processing in Twisted like in Node.js? I wrote sample with Twisted, but my app still waited an answer from long operation(I emulate this with time.sleep). Also I don't understand how can I use reactor.callLater…
Stan
  • 4,169
  • 2
  • 31
  • 39
2
votes
1 answer

Extend existing Twisted Service with another Socket/TCP/RPC Service to get Service informations

I'm implementing a Twisted-based Heartbeat Client/Server combo, based on this example. It is my first Twisted project. Basically it consists of a UDP Listener (Receiver), who calls a listener method (DetectorService.update) on receiving packages.…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
2
votes
0 answers

twisted problem, too many open files

I'm using twisted with perspective broker for my distributed application. I have faced to a problem that when I try to log in more than 54 clients to my server and invoke a simple remote_call on my remote referenceable object, it receive the error :…
Abouzar Nouri
  • 140
  • 12
2
votes
1 answer

return control to the transport

I'm trying to simulate a situation where data is received by a server periodically. In my set up, I run one process that sets up the server and another process that sets up a bunch of clients (suffices to think of a single client). I have set up…
apoursh
  • 27
  • 5
2
votes
1 answer

How to count the number of currently connected Protocols in Python twisted framework

I was trying to count the number of active protocols in twisted but i got an error: exceptions.AttributeError: Factory instance has no attribute 'numProtocols' Below is the code: class EchoPro(Protocol): def connectionMade(self): …
elf1984
  • 301
  • 1
  • 4
  • 12
2
votes
2 answers

use stringIO object as ssl key/cert file

I want to pull my ssl certificate and key from environment variables and not store them on the filesystem. But I am running into a road block with twisted ssl from io import StringIO from twisted.internet import reactor, task, threads, ssl key =…
user1601716
  • 1,893
  • 4
  • 24
  • 53
2
votes
2 answers

Python Twisted Daemon

I have written a simple twisted server - from twisted.internet import reactor from twisted.internet import protocol from twisted.web import server, resource from twisted.internet import reactor class Index(resource.Resource): isLeaf = True …
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
2
votes
3 answers

Python, Twisted, Django, reactor.run() causing problem

I have a Django web application. I also have a spell server written using twisted running on the same machine having django (running on localhost:8090). The idea being when user does some action, request comes to Django which in turn connects to…
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
2
votes
1 answer

Unhandled error in Deferred? Using UNIX socket with Twisted

I'm completely new to network programming and event driven events. However I was able to successfully implement a pub-sub scheme using a TCP connection between my machine (server) and client machines for testing (command line). However, I need to…
Brian
  • 421
  • 3
  • 20
2
votes
2 answers

Does twisted.internet.serialport 17.1.0 work on Windows?

I am trying to use twisted.internet.serial on Windows and it always fails to create with the message : "File "C:\Program Files\Python36\lib\site-packages\twisted\internet_win32seria lport.py", line 65, in _finishPortSetup flags, comstat =…
R. Wilder
  • 41
  • 3
2
votes
1 answer

Force twisted reactor to stop on sigterm

I have a GCE server setup to handle some data analysis. I can communicate with it via ws using twisted. I am the only client of this server. System is setup like this: spawn_multiprocessing_hierarchy() reactor.run() # Blocks main…
Mirac7
  • 1,566
  • 4
  • 26
  • 44
2
votes
1 answer

unicodedata is not found

I'm trying to install Twisted on a small board running a version of OpenWRT (chaos calmer). I'm running it step by step so I could track and install the missing packages on the device. Last error was: ImportError: No module named unicodedata I have…
arianvc
  • 101
  • 10
1 2
3
11 12