Tuesday, August 01, 2006

what is up with all the streams?

Is creating a new stream package a rite-of-passage for Lispers?

jsnell on #lisp pointed out the obvious to me this evening: to make a stream capable of output, use :output t, and to make it capable of input, use :input t. I figured all out on my own (and expect a lolli-pop later) that to make it binary you need :element-type :default. Alltogether it was:

(let*
((client-stream (make-socket-stream client-socket
:output t
:input t
:element-type :default))

Strangely, I had these same streams working unencumbered by the demands of a voratious OpenSSL implementation working fine. This was all to get something that CL+SSL would accept as a reasonable facimile of a stream. At this point, you have to flip things back around so you can go back to character-based operations when OpenSSL has finished reconstituting the bits from gibberish to meaningful words.

(cl+ssl:make-ssl-server-stream client-stream
:external-format :iso8859-1
:key ... :cert ... )

I very cleverly stuck Jasko with the hard part of getting the agent-side (read C++) SSL code working today (He's young and strong - I know he'll survive) In fact, not only did he survive, he beat me to getting his working against the openssl test server before I could get archon accepting connections with its certificate, We now have the two peices to the point where we can point them at each other and see if everything works.

We'll try not to cross the streams.

0 Comments:

Post a Comment

<< Home