[Twisted-Python] client send twice but server reads once

Phil Mayers p.mayers at imperial.ac.uk
Wed Nov 12 06:12:52 EST 2008

Aydın ŞEN wrote:
> Hi,
> In my code i'm sending sequential data from client like;
> self.transport.write('aydin')
> self.transport.write('adige')
> but server reads data like *'aydinadige'
> *How can i solve this, actually it is not clear how does dataReceived 
> work for me

You can't, TCP will deliver the messages and re-assemble them at will.

If you want message framing on top of TCP, you need to add it. Twisted 
comes with some several e.g. in twisted.protocols.basic you have 
LineReceiver, NetstringReceiver

> best regards..
> ------------------------------------------------------------------------
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list