Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twisted: tcp server with push producer example?

I want to put together simple TCP server using Python and Twisted.

The server starts up and waits for connection - I already have client - non-python application. Once connection is made server starts sending data at some interval (e.g. 1 sec).

The server reads data from a static file (a record at a time), I should be able to figure out this part.

I assume that I would use push producer to start pushing data once client is connected.

I have simple tcp server with factory in twisted and I can react to connectionMade/dataReceived and so on but I can't figure out how to plug in the push producer.

Anyone knows any examples showing push producer with tcp server in twisted?

like image 967
stefanB Avatar asked Oct 20 '09 00:10

stefanB


1 Answers

Here is a complete example of a push producer. It's been added to the twisted svn as an example.

like image 60
Benjamin Rutt Avatar answered Oct 02 '22 06:10

Benjamin Rutt