[Twisted-Python] writing back through open connections

David Welch dwelch at umail.ucsb.edu
Tue Mar 4 23:42:10 EST 2008


Matt,

I read that howto/servers documentation and I have set up my code into  
a Factory and Protocol that handles incoming connections. I don't  
think I explained myself well enough though. When a client connects,  
the server may or may not being send data back right away so I need to  
be able to send data to that connected client on the servers terms.  
For example:

Client 1 connects -- Factory instantiates Protocol class to handle  
communication (connection doesn't close)
Client 2 connects -- Factory instantiates Protocol class to handle  
communication (connection doesn't close)
<time has passed until server decides it needs to send a plugin to one  
of the clients>
Server sends plugin to Client 1

So how can that server send data to client 1 if client 1 hasn't caused  
an event (The server side causes a certain event it should send data  
to a selected client). I understand that if a client sends data to the  
server I can than write back to the client using the dataReceived  
function within the Protocol instantiation. In this case once N number  
of agents have connected I want the server to push data to the clients  
without the Client writing to the server. Thanks again for the help.






More information about the Twisted-Python mailing list