carroll@cs.uiuc.edu (Alan M. Carroll) (03/27/91)
We have a TCP connection server running on various UNIX boxes here, and we want to be able to connect to it from a TI. In terms of actually getting the connection and moving data on it, we have that mostly solved. The last sticking point is that certain special characters (primarily linefeed) are not the same on either end. The UNIX linefeed ends up as a delta on the TI, and the TI linefeed shows up as an ASCII 141 (cr with the high bit set). We tried using :characters :ascii with ip:open-stream, but that maps TI linefeed into UNIX cr / lf, and what we want is a one to one mapping, TI linefeed <-> UNIX linefeed. Can anyone give us any clue as to the easiest way to do this? Thanks. -- Alan M. Carroll "I hate shopping with the reality-impaired" Epoch Development Team - Susan CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll
Rice@SUMEX-AIM.STANFORD.EDU (James Rice) (03/28/91)
It sounds to me like you're trying this the hard way. The Explorer's normal stream/file capability does this for you for free (assuming I understand what you're trying to do). All you need do is (open "<<my-unix-box>>:<<my-file>>" :direction :input :characters t) and it will open a stream of the right type. Actually it even defaults in to :characters t and :direction :input anyway. If you're trying to do anything more clever than this then you need to know that what the Explorer actually opens, when you do the above, is a stream of the flavor ip:ascii-translating-character-stream. This flavor of stream does more than frob the crlf problem, it also deals with all of the other chars in the Explorer character set. If you really want to do something more clever than this then you should probably just specialize this class of stream and open a stream of your new flavor. The easiest way to do this (since you are overriding the way that the generic network code deduces what sort of stream to open for a given medium is to bind the variable ip:*tcp-stream-instantiator*, which can be a function that actually does a make-instance on the flavor of stream that you want. Rice.