On Jul 28, 2015, at 10:09 AM, Alexey Panyovin <a@runtel.ru> wrote:

Hello all.
Help me please.
Tell me how to wrap in Defer dataReceived.
For example, I need to execute a command and send receive data in callback. The only yet I found - to use the session number sent commands and replies received

If you want to have commands and responses, you need a higher-level callback than simply dataReceived.  This is what, for example, AMP <https://twistedmatrix.com/documents/current/api/twisted.protocols.amp.html> is for.

-glyph