On 28. M=E4r 2004, at 14:24, Daniel Barlow wrote:
> james@... (James A. Crippen) writes:
>
>> Right now I'm implementing telnet-stream with a hackish class that
>> wraps up the fd-stream into a slot along with other stuff. This works
>> okay but it means that I have to provide implementations of *every*
>> stream function for this new class that know how to pull out the
>
> [...]
>
> This is not a recommendation as I've never used it myself, but you
> might want to look at the sb-simple-streams contrib and see if that
> helps.
>
> Perhaps someone who has (or has used Allegro-style simple streams on
> some other platform) can chip in.
Haven't used simple-streams in anger myself ... my gut feeling is that=20=
they perhaps aren't a good match. The key idea of simple-streams is=20
that the upper layers (read-char, write-sequence, ...) stay the same=20
and work on a common buffering layer, and new stream types customize=20
device-read, device-write, device-open etc.
So, I /think/ having a telnet simple-stream would mean you'd have to=20
sprinkle the application code with (finish-output) to empty the buffer=20=
at every step. If that is not a problem, for a simple-telnet-stream=20
I'd have a look at subclassing socket-stream. simple-streams are=20
created via `def-stream-class' and their slots are accessed with `sm'=20
instead of `slot-value' (see also the `with-simple-stream' macro &=20
friends). (this protocol is an efficiency hack; Franz has=20
documentation for simple-streams on their web site.)
If you decide to try them out, I'd be interested to hear how it's=20
working out.
Cheers,
Rudi
|