So, I'm following the fingerd tutorial on the twisted docs, but I bumped into a weird thing
In this code: https://bpaste.net/show/376e161b9628, the commented method works properly when I test it with telnet, but the non-commented one doesn't. The connection gets dropped, but I don't receive the value that is written in the transport
What am I missing in the method using @inlineCallbacks?
clokep joined the channel
clokep joined the channel
Ok, so, apparently, if I don't wrap lineReceived in inlineCallbacks, but put code in another method and call it from there, wrap this method with inlineCallbacks, and call it from lineReceived, it works.
Still don't know why, though =(
runciter
adourado: a callable decorated with @inlineCallbacks returns a Deferred when called
adourado: if lineReceived returns something truthy, it will disconnect the protocol, for historical reasons
this is deprecated behavior
adourado: Deferreds are truthy
(the actual deprecated behavior is a protocol disconnects if dataReceived returns a truthy value, but this carries through to lineReceived because LineReceiver.dataReceived returns whatever lineReceived returns, if it returns a truthy value)