Telnet usage: Difference between revisions

Jump to navigation Jump to search
m
http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg31243.html
m (http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg01402.html)
m (http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg31243.html)
Line 33: Line 33:
The telnet mechanism is not designed to be high bandwidth.  I believe it runs at 5hz? and only processes one line/command per iteration. You could try upping the frequency via the command line, "--props=socket,bi,20,,5500,tcp" (we could change PropsChannel::foundTerminator() to handle several
The telnet mechanism is not designed to be high bandwidth.  I believe it runs at 5hz? and only processes one line/command per iteration. You could try upping the frequency via the command line, "--props=socket,bi,20,,5500,tcp" (we could change PropsChannel::foundTerminator() to handle several
commands per line.  Commands could be separated with semicolons.  Or perhaps some commands could take more than one argument, eg "get /foo/bar /foo/baz"). For higher bandwidth needs, it would work better to send over an FGNetFDM structure (src/Network/net_fdm.hxx) via UDP or some other custom structure.
commands per line.  Commands could be separated with semicolons.  Or perhaps some commands could take more than one argument, eg "get /foo/bar /foo/baz"). For higher bandwidth needs, it would work better to send over an FGNetFDM structure (src/Network/net_fdm.hxx) via UDP or some other custom structure.
A look at the sources shows that a fixed polling interval is used for telnet - default is 5Hz. So it cannot process more than 5 commands per
second. That's why it's slow. There's better methods of implementing socket communication instead of polling, but I haven't looked into the
module and don't know why this was chosen. The polling interval is configurable though - so you can speed it up. Use:
<pre>
    fgfs ..... --telnet=medium,direction,HZ,localhost,PORT,style
</pre>
Use HZ to select the polling frequency (e.g. "100") and PORT for the telnet port (e.g. 9999). The other parameters are unused (it seems) when
using the telnet protocol. Probably there for historic reasons (?). Maybe Curt knows. Remember you have to specify 6 parameters separated by
a "," - otherwise you cannot configure the polling frequency. So call
something like:
<pre>
    fgfs ..... --telnet=foo,bar,100,foo,9999,bar
</pre>


TCP sockets are easier to implement for almost all applications, precicely because they are reliable.  UDP will only look easier if you plan on skipping the code to recover from a lost packet.  Some applications can do this, but the property tree can't -- property access is non-idempotent in the general case. Listeners can have side effects.
TCP sockets are easier to implement for almost all applications, precicely because they are reliable.  UDP will only look easier if you plan on skipping the code to recover from a lost packet.  Some applications can do this, but the property tree can't -- property access is non-idempotent in the general case. Listeners can have side effects.

Navigation menu