I am following official Twisted examples about client/server. I am using LineReceiver.sendLine() to send text from client to server. This code works:
def connectionMade(self):
self.sendLine("Hello, world!")
and I can see it on my server side. But if I add something like this:
def connectionMade(self):
while self.running:
command = raw_input(">>")
if command=="disconnect":
self.running = False
else:
print "sending..."
self.sendLine(command)
print "sent."
self.sendLine("Hello, world!")
I can see both 'sending...' and 'sent', but nothing more. Server receives nothing even though client appears to be sending the data. If I type 'disconnect' everything is being sent at once, including 'Hello, world!'
Hence my question: where does the actual sending takes place? And what to do to achive something like above?