[gforth] / gforth / unix / terminal-server.fs  

gforth: gforth/unix/terminal-server.fs

File: [gforth] / gforth / unix / terminal-server.fs (download)
Revision: 1.2, Thu Aug 9 23:58:53 2012 UTC (9 months, 2 weeks ago) by pazsan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
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 ;

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help