lee.a.connell at gmail.com
Sun Feb 25 18:26:33 EST 2007
I am building a basic chat program. I am using LineReceiver for the
protocol on both the server and the client. My problem is when i loop
through all the clients in my ServerFactory and choose to send data to the
client with multiple calls to transport.write(data), the client side does
not pick it up in two seperate calls, instead it is received in one
lineReceive. In the server I call transport.write() twice, the client
however receives both calls in one lineReceive instead of two lineRecieve
calls, how can I get lineReceive to be fired for each transported message?
//// CLIENT LINE RECEIVE ////
def lineReceived(self, line):
//// SERVER CONNECTION MADE ////
host = self.transport.getPeer().host + ": joined the server."
for c in self.factory.clients:
c.transport.write(host + '\n')
if self == c:
c.transport.write(self.getMOTD()) ### getMOTD just returns
some string ###
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python