[usocket-devel] Portably supporting :external-format

Erik Huelsmann ehuels at gmail.com
Sun Oct 22 08:50:42 UTC 2006


On IRC, I had some discussions whether it would be enough to just
support octet streams, but it looks like not all implementations
support octet streams. Definitely not all of them support
:external-format for sockets.

So, as I mentioned in earlier posts, it might be a good idea to start
depending on flexi-streams: this gives us portable external-formats as
well as *bivalent* streams. The latter is important for many TCP/IP
protocols: HTTP has a character header, but binary content. Other
protocols have that too (8BIT smtp).

So, to stay backward compatible, this is what I'd like to do:

- If no external-format is given: just return the raw stream returned
by the implementation (as we do now)
- If an external-format is specified, create a raw stream with 'octet'
element-type and wrap the returned stream with a flexi-stream,
exposing the flexi-stream to the caller.

How about that?

bye,

Erik.



More information about the usocket-devel mailing list