(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED " 7-Sep-88 17:17:04" {ERINYES}MEDLEY>CHATSERVER-NS.;2 7560 changes to%: (FNS MAKE.NS.CHAT.CONNECTION) previous date%: "16-Mar-88 22:34:39" {ERINYES}MEDLEY>CHATSERVER-NS.;1) (* " Copyright (c) 1987, 1988 by Xerox Corporation. All rights reserved. ") (PRETTYCOMPRINT CHATSERVER-NSCOMS) (RPAQQ CHATSERVER-NSCOMS [(FNS MAKE.NS.CHAT.CONNECTION NS.CHAT.SERVE NSCHAT.SERVER.ATTENTION NSCHAT.SERVER.OUTPUTABORTED NSCHAT.SERVER.WHENCLOSED SPP.EOMP \NSCHAT.BIN \REMOTE.EOFP \REMOTE.PEEKBIN \REMOTE.READP GAP-SERVER-INIT) (FILES COURIERSERVE CHATSERVER) (DECLARE%: DONTEVAL@LOAD DOCOPY (P (GAP-SERVER-INIT) (COURIER.START.SERVER))) (DECLARE%: EVAL@COMPILE DONTCOPY (FILES (SOURCE) MODARITH) (FILES (LOADCOMP) LLNS SPP)) (FUNCTIONS CHECK) (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML) (LAMA MAKE.NS.CHAT.CONNECTION ]) (DEFINEQ (MAKE.NS.CHAT.CONNECTION (CL:LAMBDA (CSTREAM CPROG CPROC PARAMETERS TRANSPORT WAITTIME CREDENTIALS VERIFIER) (* ; "Edited 2-Sep-88 23:43 by masinter") (LET ((OUTPUTSTREAM (SPPOUTPUTSTREAM CSTREAM))) (with SPPCON (fetch SPP.CONNECTION of CSTREAM) (SETQ SPPEOMONFORCEOUT T) (SETQ SPPATTENTIONFN (FUNCTION NSCHAT.SERVER.ATTENTION)) (SETQ SPPOUTPUTABORTEDFN (FUNCTION NSCHAT.SERVER.OUTPUTABORTED)) (SETQ SPPWHENCLOSEDFN (FUNCTION CHATSERVERWHENCLOSEDFN))) (with STREAM CSTREAM (SETQ DEVICE (create FDEV DEVICENAME _ 'NSCHATDEVICE (* ; "") PEEKBIN _ #'\REMOTE.PEEKBIN (* ; "") READP _ #'\REMOTE.READP (* ; "") EOFP _ #'\REMOTE.EOFP (* ; "") GETEOFPTR _ (FUNCTION NILL) (* ; "") BIN _ '\NSCHAT.BIN using DEVICE)) (SETQ STRMBINFN '\NSCHAT.BIN)) (* ;; "return the value, and then ") [COURIER.RETURN CSTREAM CPROG CPROC '((0 0] (SPP.FORCEOUTPUT OUTPUTSTREAM) (SPP.SENDATTENTION CSTREAM 209) (PROCESS.NAME (THIS.PROCESS) 'CHAT.SERVER) (SPP.DSTYPE OUTPUTSTREAM 192) (CHATSERVEROPENFN CSTREAM OUTPUTSTREAM)))) (NS.CHAT.SERVE (LAMBDA (INPUTSTREAM OUTPUTSTREAM OPENFN WHENCLOSEDFN) (* lmm " 7-Jan-86 13:21") (PROG (PARAMETERS TRANSPORT WAITTIME CREDENTIALS VERIFIER) (repeatuntil (SPP.READP INPUTSTREAM) do (BLOCK)) (for I to 4 do (* Echo Courier version number) (BOUT OUTPUTSTREAM (BIN INPUTSTREAM))) (SPP.SENDEOM OUTPUTSTREAM) (SPP.CLEAREOM INPUTSTREAM) (repeatuntil (SPP.READP INPUTSTREAM) do (BLOCK)) (for I to 12 do (* Courier protocol bytes |...|) (BIN INPUTSTREAM)) (SETQ PARAMETERS (COURIER.READ INPUTSTREAM (QUOTE GAP) (QUOTE SessionParameterObject))) (SETQ TRANSPORT (COURIER.READ INPUTSTREAM (QUOTE GAP) (QUOTE Sequence.TransportObject))) (SETQ WAITTIME (COURIER.READ INPUTSTREAM (QUOTE GAP) (QUOTE WaitTime))) (SETQ CREDENTIALS (COURIER.READ INPUTSTREAM (QUOTE GAP) (QUOTE credentials))) (SETQ VERIFIER (COURIER.READ INPUTSTREAM (QUOTE GAP) (QUOTE verifier))) (* Courier RETURN command) (BOUT OUTPUTSTREAM 0) (BOUT OUTPUTSTREAM 2) (BOUT OUTPUTSTREAM 0) (BOUT OUTPUTSTREAM 0) (COURIER.WRITE OUTPUTSTREAM (QUOTE (0 0)) (QUOTE GAP) (QUOTE SessionHandle)) (SPP.SENDEOM OUTPUTSTREAM) (SPP.FLUSH.TO.EOF INPUTSTREAM) (with STREAM OUTPUTSTREAM (SETQ EOLCONVENTION 2)) (with STREAM INPUTSTREAM (SETQ IMAGEDATA OUTPUTSTREAM) (SETQ DEVICE (create FDEV DEVICENAME _ (QUOTE NSCHAT) BIN _ (FUNCTION \REMOTE.BIN) PEEKBIN _ (FUNCTION \REMOTE.PEEKBIN) READP _ (FUNCTION \REMOTE.READP) EOFP _ (FUNCTION \REMOTE.EOFP) GETEOFPTR _ (FUNCTION NILL) using DEVICE)) (SETQ STRMBINFN (FUNCTION \REMOTE.BIN))) (SPP.CLEAREOM INPUTSTREAM T) (SPP.CLEARATTENTION INPUTSTREAM T) (CHATSERVEROPENFN INPUTSTREAM OUTPUTSTREAM) (SPP.CLOSE INPUTSTREAM T))) ) (NSCHAT.SERVER.ATTENTION (LAMBDA (X) (* ; "Edited 6-Oct-87 13:25 by Masinter") (SPP.CLEARATTENTION X T) (LET (BYTE) (SELECTQ (SETQ BYTE (BIN X)) (209 (* ; "attention 209, whatever that is") NIL) (PRINTOUT PROMPTWINDOW T "attention byte " BYTE " recieved.")))) ) (NSCHAT.SERVER.OUTPUTABORTED (LAMBDA (STREAM X Y Z) (* lmm "10-Jan-86 00:32") NIL)) (NSCHAT.SERVER.WHENCLOSED (LAMBDA (STREAM X Y Z) (* lmm " 9-Jan-86 18:06") (CLOSEF? (SPPOUTPUTSTREAM STREAM)))) (SPP.EOMP (LAMBDA (STREAM) (* ; "Edited 6-Oct-87 13:04 by Masinter") (EQ (fetch SPPEOFBITS of STREAM) \SPPFLAG.EOM)) ) (\NSCHAT.BIN (LAMBDA (STREAM) (* ; "Edited 30-Oct-87 10:35 by Masinter") (until (\REMOTE.READP STREAM) do (BLOCK)) (\BUFFERED.BIN STREAM)) ) (\REMOTE.EOFP (LAMBDA (STREAM) (* ; "Edited 6-Oct-87 11:37 by Masinter") (* ;; "terminal EOF: never") NIL)) (\REMOTE.PEEKBIN (LAMBDA (STREAM NOERRORFLG) (* ; "Edited 6-Oct-87 11:35 by Masinter") (* ;; "SPP peek: ignore EOM") (until (SPP.READP STREAM) do (if (SPP.EOMP STREAM) then (SPP.CLEAREOM STREAM T)) (BLOCK)) (PROG ((BYTE (\BUFFERED.PEEKBIN STREAM NOERRORFLG))) (if (SPP.EOMP STREAM) then (SPP.CLEAREOM STREAM T)) (RETURN BYTE))) ) (\REMOTE.READP (LAMBDA (STREAM) (* ; "Edited 6-Oct-87 14:06 by Masinter") (* ;; " termal READP: ignore EOM") (PROG NIL RETRY (COND ((SPP.READP STREAM) (RETURN T)) ((SPP.EOMP STREAM) (SPP.CLEAREOM STREAM) (GO RETRY)) (T (RETURN NIL))))) ) (GAP-SERVER-INIT (LAMBDA NIL (LET* ((DEF (GETDEF (QUOTE GAP) (QUOTE COURIERPROGRAMS))) (LST (CDDDR (ASSOC (QUOTE Create) (CL:GETF (CDR DEF) (QUOTE PROCEDURES)))))) (CL:UNLESS (EQ (CL:GETF LST (QUOTE IMPLEMENTEDBY)) (QUOTE MAKE.NS.CHAT.CONNECTION)) (CL:SETF (CL:GETF LST (QUOTE IMPLEMENTEDBY)) (QUOTE MAKE.NS.CHAT.CONNECTION)) (PUTDEF (QUOTE GAP) (QUOTE COURIERPROGRAMS) DEF))) (COURIER.START.SERVER)) ) ) (FILESLOAD COURIERSERVE CHATSERVER) (DECLARE%: DONTEVAL@LOAD DOCOPY (GAP-SERVER-INIT) (COURIER.START.SERVER) ) (DECLARE%: EVAL@COMPILE DONTCOPY (FILESLOAD (SOURCE) MODARITH) (FILESLOAD (LOADCOMP) LLNS SPP) ) (DEFMACRO CHECK (X) `(CL:ASSERT ,X)) (DECLARE%: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDTOVAR NLAMA ) (ADDTOVAR NLAML ) (ADDTOVAR LAMA MAKE.NS.CHAT.CONNECTION) ) (PUTPROPS CHATSERVER-NS COPYRIGHT ("Xerox Corporation" 1987 1988)) (DECLARE%: DONTCOPY (FILEMAP (NIL (1506 7035 (MAKE.NS.CHAT.CONNECTION 1516 . 3560) (NS.CHAT.SERVE 3562 . 5186) ( NSCHAT.SERVER.ATTENTION 5188 . 5454) (NSCHAT.SERVER.OUTPUTABORTED 5456 . 5543) ( NSCHAT.SERVER.WHENCLOSED 5545 . 5660) (SPP.EOMP 5662 . 5785) (\NSCHAT.BIN 5787 . 5931) (\REMOTE.EOFP 5933 . 6045) (\REMOTE.PEEKBIN 6047 . 6381) (\REMOTE.READP 6383 . 6625) (GAP-SERVER-INIT 6627 . 7033))) )) STOP