file: 07-C-telnet.t package: telnet status: alpha
This function is designed to be invoked by a shell during startup, to start a telnet daemon running for the current session if appropriate.
It is currently implemented as:
: maybeStartTelnetDaemon { -> }
( Find our socket: )
@$s.jobSet$s.session$s.socket -> socket
( We attempt to only run the telnetDaemon )
( when there's likely to be telnet support )
( on the other end. In particular, if )
( socket$S.type is :tty we are on a direct )
( console connection: )
socket$S.type :tcp = not if return fi
( Let's not clobber a telnetDaemon which )
( is already running: )
socket$S.telnetOptionLock if return fi
( Go for it: )
me$s.telnetDaemon -> daemon
daemon compiledFunction? not if
#'telnet:start -> daemon
fi
daemon compiledFunction? if
daemon call{ -> }
fi
;
Go to the first, previous, next, last section, table of contents.