Re: [Flightgear-devel] props protocol problem
On 16.04.2011 02:06, Pascal J. Bourguignon wrote: The props data protocol ls command has a problem: there's no way to determine that its output is complete (unless we use a timer, which would mean that all ls commands would suspend the client for the time out duration). I'm proposing to add a lsx command, similar to ls, but that will terminate its output with an empty line. Hi Pascal, before we duplicate commands: couldn't you detect output completion by reading until the prompt? When output is complete, the server prints a linefeed (\n) and a / (followed by an optional property path and ). Should be easy to parse. Ok, the prompt is only printed in PROMPT mode (obviously). There is no prompt in RAW mode. But then it might be better to add another output mode, i.e. a mode similar to RAW which completes _every_ existing command with a specific character sequence, such as an additional linefeed. Adding another command (lsx) wouldn't cost much - but then we should also add new versions of all other commands (getx, dumpx, runx, ...) for the same reason. So, a different output mode seems a better solution? Or also possible: just add a new option to configure the prompt in PROMPT mode. So everyone can configure this to his needs. To see what I mean, try export PS1=FOO\nBAR\n in your linux console - or set prompt=#FOOBAR# in your Win-DOS box. Might be a better solution if you added something similar to props.cxx. Any other thoughts? cheers, Thorsten -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] props protocol problem
ThorstenB bre...@gmail.com writes: On 16.04.2011 02:06, Pascal J. Bourguignon wrote: The props data protocol ls command has a problem: there's no way to determine that its output is complete (unless we use a timer, which would mean that all ls commands would suspend the client for the time out duration). I'm proposing to add a lsx command, similar to ls, but that will terminate its output with an empty line. Hi Pascal, before we duplicate commands: couldn't you detect output completion by reading until the prompt? I was using the data mode. In the meanwhile I detected another problem with get returning multi-line strings. Also there's nothing preventing some lines in the string to start with -ERR which would be interpreted as an error report. When output is complete, the server prints a linefeed (\n) and a / (followed by an optional property path and ). Should be easy to parse. Ok, the prompt is only printed in PROMPT mode (obviously). There is no prompt in RAW mode. But then it might be better to add another output mode, i.e. a mode similar to RAW which completes _every_ existing command with a specific character sequence, such as an additional linefeed. Adding another command (lsx) wouldn't cost much - but then we should also add new versions of all other commands (getx, dumpx, runx, ...) for the same reason. So indeed, I had to add a getx. So, a different output mode seems a better solution? Right. The data mode seems entirely unusable. Or also possible: just add a new option to configure the prompt in PROMPT mode. So everyone can configure this to his needs. To see what I mean, try export PS1=FOO\nBAR\n in your linux console - or set prompt=#FOOBAR# in your Win-DOS box. Might be a better solution if you added something similar to props.cxx. Any other thoughts? Well, some more thought is needed, since I also notice that it is quite slow to dump the whole property tree. The props protocol doesn't seem adapted to my needs. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
[Flightgear-devel] props protocol problem
The props data protocol ls command has a problem: there's no way to determine that its output is complete (unless we use a timer, which would mean that all ls commands would suspend the client for the time out duration). I'm proposing to add a lsx command, similar to ls, but that will terminate its output with an empty line. In props.cxx, replace: if (command == ls) { with: if((command == ls)||(command == lsx)){ and add: if (command == lsx){ push( getTerminator() ); } at the end of the branch. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel