Hi Todd,

> I've been porting my "pure" Common Lisp MQTT client to Picolisp, and it has 
> gone
> very well for non-SSL connections (I just used "connect"), but I am looking 
> for
> a canonical way to connect to a SSL/TLS encrypted socket (no certs needed, I
> just need basic encryption).

> (de mq-open (Host Port SSL)
>    (if SSL
>       (pipe
>          (exec "ncat" "--ssl" Host Port) )
>       (connect Host Port) ) )
> 
> Is this a good approach?

Yes, looks good.


> Using the FFI to call openssl library is more efficient, but I didn't want to 
> go
> that path yet...

I would not worry about efficiency here, because just a single process is
started once.


> Once concern I have with the above code is dealing with when a connection is
> dropped.

I would use the file descriptor returned from the above function in a 'task',
and close (and perhaps restart) it when reading returns NIL (EOF).

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to