<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16981" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left> </DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=512361800-24022010>Hi Folks ..</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010><SPAN
class=184094700-24022010>I'm not entirely a newbie a python and twisted, but I
have come to the point where I need a bit more expertise on this topic, so
I am hoping that I have come to the right place
.. </SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010><SPAN
class=184094700-24022010></SPAN></SPAN></FONT> </DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2><SPAN
class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000>What </FONT> </FONT></SPAN>I'm hoping<SPAN
class=184094700-24022010>, </SPAN>that <SPAN
class=184094700-24022010><FONT color=#0000ff> <FONT color=#000000>you
folks</FONT> </FONT></SPAN>can help out with a<SPAN
class=184094700-24022010><FONT color=#0000ff> </FONT><FONT
color=#000000>minor </FONT></SPAN>prob<SPAN
class=184094700-24022010>l</SPAN>em that I am having with <SPAN
class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000>the</FONT> </FONT></SPAN>twistd reactor
class and/or <SPAN class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000>the</FONT> </FONT></SPAN>callLater <SPAN
class=184094700-24022010>function</SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=512361800-24022010><SPAN class=184094700-24022010><FONT
face=Arial size=2> </FONT>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010>I have been using a
reactor.callLater function to schedule an event that happens in the reactor to
send out a heartbeat type message at regular intervals .. This works great
!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2>However, it
appears to me that the self.sendLine(msg) <SPAN
class=184094700-24022010><FONT color=#0000ff> <FONT color=#000000>and
or</FONT> </FONT>the self.transport.write(msg) </SPAN>writ<SPAN
class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000>ing</FONT> </FONT></SPAN> functio<FONT color=#0000ff><SPAN
class=184094700-24022010><FONT color=#000000>ns</FONT> </SPAN><SPAN
class=184094700-24022010><FONT color=#000000>are</FONT></SPAN></FONT> blocked
function<SPAN class=184094700-24022010>s </SPAN>waiting for <SPAN
class=184094700-24022010>a</SPAN><SPAN
class=184094700-24022010> </SPAN>reactor event<SPAN
class=184094700-24022010> to occur at a future scheduled </SPAN>time before
acutally flushing out the internal write buffers .. <SPAN
class=184094700-24022010><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2><SPAN
class=184094700-24022010></SPAN></FONT></FONT></SPAN> </DIV></SPAN></SPAN></DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2>I am currently
using the twistd protocol factory to create a custom protocol to communicate
between a server and client<SPAN class=184094700-24022010><FONT color=#0000ff>,
</FONT></SPAN><SPAN class=184094700-24022010>which up until now has not
been a real concern, but I am trying to improve the preformance and turn around
time between the client and server and this blocking operation is a major
source of unneeded delay .. </SPAN></FONT></FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010>My problem is that I
have scheduled heartbeat events that I want to send to the server .. as
well as <SPAN class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000> the</FONT> </FONT></SPAN>non scheduled events that I
want to g<SPAN class=184094700-24022010>o </SPAN> to the server imediately
.. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010>I have been scouring
the various python/twistd document sites, <SPAN
class=184094700-24022010><FONT color=#0000ff><FONT color=#000000>but to
no avial</FONT>, </FONT></SPAN> on all of the site<SPAN
class=184094700-24022010>s </SPAN>that I have seen, the method used ha<SPAN
class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000>ve</FONT> </FONT></SPAN> all done the same thing<SPAN
class=184094700-24022010><FONT color=#0000ff> , </FONT></SPAN> by
re-scheduling something into the future with a reactor.callLater () function,
which causes a delayed write to occur .. not a problem for something that is 1
or 2 secon<SPAN class=184094700-24022010><FONT color=#0000ff><FONT
color=#000000>d</FONT> </FONT></SPAN>s in the furture, but it is a serious
problem when the next event is 120 seconds away .. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2>I have tried
using a self.transport.write(msg) function, but the actual communication still
seems to be buffered and stuck waiting for the scheduled reactor event ..<SPAN
class=184094700-24022010><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2><SPAN
class=184094700-24022010></SPAN></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial><FONT size=2><SPAN
class=184094700-24022010><FONT color=#0000ff><FONT color=#000000>What I think I
need is something similar to</FONT> </FONT> self.transport.flush()
which would flush out the write buffers on demand, but does not seen to exist
..</SPAN></FONT></FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010>I am hoping that
someone has faced the same/similar stituation and give me some guidance and/or
to point me in the correct direction .. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=512361800-24022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=512361800-24022010>Thanks for any help
you can offer ..</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial
size=2>Cheers</FONT></SPAN></DIV>
<DIV><SPAN class=512361800-24022010><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV align=left><FONT face=Arial size=2>Dave Watson</FONT></DIV></BODY></HTML>