File:  [gforth] / gforth / unix / terminal-server.fs
Revision 1.2: download - view: text, annotated - select for diffs
Thu Aug 9 23:58:53 2012 UTC (11 years, 8 months ago) by pazsan
Branches: MAIN
CVS tags: HEAD
debug file id generalized, fixed uninitialized xc\!+

\ terminal server for Gforth

require unix/socket.fs

4444 Value gforth-port#

: term-cr "\x0d\x0a" type outfile-id flush-file throw ;

: get-connection ( -- )
    gforth-port# create-server { lsocket }
    lsocket 1 listen
    lsocket accept-socket
    dup to infile-id
    dup to outfile-id
    to debug-fid
    ['] term-cr is cr
    key drop BEGIN  key? WHILE key drop REPEAT ;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>