[Twisted-Python] Don't Finalize Connection

Hi, i am fairly new to twisted and try to work my way trough the documentation. There is a problem I can't find a solution for. Maybe somebody can give me a hint or point me into the right direction. I am trying to create a TCP server. The client connects to the server, then the server will send multiple commands and binary data to the client. After the data has been send, the connection should stay open. I subclass "Protocol" to create my protocol. It seems that after i send data with self.transport.write(data) the last packet will be send with the "FP." flag, what seems to "Finalize" the connection from this end. Is there a way to force twisted to just "Push" my data, but not to "Finalize" the connection? Thanks. Thomas

Hi Thomas, On Tue, Jul 23, 2013 at 4:15 AM, Thomas Hommers <thomas.hommers@ebalu.com>wrote:
I can't find any information on the "FP" flag in either IP or TCP. Either way, if you just call self.transport.write, nothing is finalized. Only when you call loseConnection is the connection lost :) Are you observing any behavior that suggests that the connection is lost or "finalized"? (I must admit I'm unfamiliar with the latter term, and have no idea what you're referring to.) Thanks.
Thomas

Hi, On Tue, Jul 23, 2013 at 1:16 PM, Phil Mayers <p.mayers@imperial.ac.uk>wrote:
He means "FIN+PSH" in the TCP flags field.
Ah! That makes a lot more sense :)
Right. The only thing we can say for sure is that just calling self.transport.write a couple of times won't cause that to happen. Thomas, could you produce a SSCCE (http://sscce.org/) for this behavior? Does it persist with a Twisted client and server? cheers lvh

Hi Thomas, On Tue, Jul 23, 2013 at 4:15 AM, Thomas Hommers <thomas.hommers@ebalu.com>wrote:
I can't find any information on the "FP" flag in either IP or TCP. Either way, if you just call self.transport.write, nothing is finalized. Only when you call loseConnection is the connection lost :) Are you observing any behavior that suggests that the connection is lost or "finalized"? (I must admit I'm unfamiliar with the latter term, and have no idea what you're referring to.) Thanks.
Thomas

Hi, On Tue, Jul 23, 2013 at 1:16 PM, Phil Mayers <p.mayers@imperial.ac.uk>wrote:
He means "FIN+PSH" in the TCP flags field.
Ah! That makes a lot more sense :)
Right. The only thing we can say for sure is that just calling self.transport.write a couple of times won't cause that to happen. Thomas, could you produce a SSCCE (http://sscce.org/) for this behavior? Does it persist with a Twisted client and server? cheers lvh
participants (3)
-
Laurens Van Houtven
-
Phil Mayers
-
Thomas Hommers