server sends '0' when it is done processing cmd.

This finally work pretty well for the limited case.
Still does not handle file transfer nor external commands.