I neglected to mention that the previous example requires some changes to CFFI to get things to compile in the first place. The attached patch is my attempt at bringing the ABCL CFFI code forward to support the :calling-convention -> :convention that must have been made a while back.
Cyrus
On 11/16/10 12:19 AM, Cyrus Harmon wrote:
I neglected to mention that the previous example requires some changes to CFFI to get things to compile in the first place. The attached patch is my attempt at bringing the ABCL CFFI code forward to support the :calling-convention -> :convention that must have been made a while back.
It looks like we should relax the restriction on ABCL's internal socket routines to accept subtypes of (UNSIGNED-BYTE 8) as allowed by the attached patch.
This gets DRAKMA a little further with SSL connections, but then the CL+SSL code fails as follows as we need an implementation of callbacks in CFFI. Not sure how much work that would be, but I'll take a look when I get time (if someone else wants to jump in here, please do by all means).
callback support unimplemented [Condition of type SIMPLE-ERROR]
Restarts: 0: [RETRY] Retry SLIME REPL evaluation request. 1: [*ABORT] Return to SLIME's top level. 2: [ABORT] Abort thread.
Backtrace: 0: (#<FUNCTION {20913236}> #<SIMPLE-ERROR {7D63B1F4}> #<FUNCTION {20913236}>) 1: (APPLY #<FUNCTION {20913236}> (#<SIMPLE-ERROR {7D63B1F4}> #<FUNCTION {20913236}>)) 2: (SYSTEM::RUN-HOOK SYSTEM::*INVOKE-DEBUGGER-HOOK* #<SIMPLE-ERROR {7D63B1F4}> #<FUNCTION {20913236}>) 3: (INVOKE-DEBUGGER #<SIMPLE-ERROR {7D63B1F4}>) 4: (ERROR "callback support unimplemented") 5: (CFFI-SYS:%CALLBACK CL+SSL::LISP-WRITE) 6: (CL+SSL:MAKE-SSL-CLIENT-STREAM #<TWO-WAY-STREAM {593C7B26}> :CLOSE-CALLBACK #<FUNCTION {11B9298F}>) 7: (DRAKMA::MAKE-SSL-STREAM #<TWO-WAY-STREAM {593C7B26}>) 8: (DRAKMA:HTTP-REQUEST "https://www.google.com")
On 11/30/10 7:19 PM, Mark Evenson wrote: […]
This gets DRAKMA a little further with SSL connections, but then the CL+SSL code fails as follows as we need an implementation of callbacks in CFFI. Not sure how much work that would be, but I'll take a look when I get time (if someone else wants to jump in here, please do by all means).
callback support unimplemented [Condition of type SIMPLE-ERROR]
[…]
Luís Olivera notes in the comments for the unimplemented callback support that ABCL lacks support for dynamically creating the Java interfaces used by JNA. As of [r13071 on ABCL trunk][1], with help from Erik I've enabled the new classwriter to create dynamic interfaces.
Now on to implementing CFFI callbacks.
[1]: http://trac.common-lisp.net/armedbear/changeset/13072
On 11/30/10 9:44 PM, Mark Evenson wrote: […]
As of [r13071 on ABCL trunk][1], with help from Erik I've enabled the new classwriter to create dynamic interfaces.
The definitions of interfaces created by r13071 couldn't be loaded properly by the JVM. [svn r13078 on ABCL trunk][1] fixes this as can be verified by the [working sample code of dynamically creating Java interfaces with JVM posted to the ABCL technical wiki][2].
[2]: http://trac.common-lisp.net/armedbear/changeset/13078 [3]: http://trac.common-lisp.net/armedbear/wiki/UsingClassWriter
armedbear-devel@common-lisp.net