AFAIR I was connecting over wifi to the REPL on my Android device.

If the port forwarding works fine - do you have some logs either from emacs or running ECL process which show what's going on?

Daniel


On 19.08.2017 22:24, PR wrote:
thanks to both of you, but it still doesn't work.

 From the PC, I did:

   $ adb forward tcp:4005 tcp:4005

so, this part works.

Daniel, I already "stole" the functions from the "ecl-android" project
(prior to post my question); without them I would have been lost...

So, I'll have to play around a little... Of course I will post the
solution here, if I get it to work.

Paul


2017-08-19 17:27 GMT+02:00, Daniel Kochmański <dan...@turtleware.eu>:
Hello,

swank listens by default only for localhost connections (for a good
reason!). To force it to listen for connections from specific host other
than 127.0.0.1 you have to bind swank::*loopback-interface* to it. For
instance to listen for connections from everywhere on port 4005 you
could use functions from
https://gitlab.common-lisp.net/ecl/ecl-android/blob/master/assets/lisp/etc/user.lisp

(defun start-swank ()
    (format t "Starting swank server~%")
    (mp:process-run-function
     "SLIME-listener"
     (lambda ()
       (let ((swank::*loopback-interface* "0.0.0.0"))
         (swank:create-server :port 4005
                              :dont-close t
                              ;; :style nil #|:spawn|#
                              )))))

(defun stop-swank ()
    (format t "Stopping swank server~%")
    (swank:stop-server 4005)
    (format t ";; Swank off-line~%"))

Note, that newest slime/swank should support :spawn communication style
just fine with ECL (my PR was merged lately). In that case it should be
enough to call create-server which won't block (note that in the example
above we create separate thread for that).

Since ECL isn't run from CLI but as shared library, it is useful to
define implementation for implementation program (don't remeber for
sure, but I think lack of this caused some problems later)

(defimplementation lisp-implementation-program ()
    "Return the argv[0] of the running Lisp process, or NIL."
    "org.lisp.ecl")

Hope this helps.

Best regards,

Daniel


On 19.08.2017 16:32, PR wrote:
Hi again,

so, the progress of the new android REPL is going well, it already
runs Quicklisp and can start swank, and right there I'm stuck now:
How does one connect from the local computer to the android device,
which is running the SLIME-listener?

They are connected via USB, and the device is /not/ rooted.

Since this is certainly of public interest, I ask here, thanks for any
help!
Below the link to the current APK of the REPL (you'll need android
version >= 4.1, API >= 16):

http://lights-of-holiness.eu/tmp/repl.apk

After launching the app, do (there is currently no feedback of the
progress, sorry):

    (quicklisp)   ; should take less than a minute, with a fast internet
connection
    (start-swank) ; same as above (needs to byte-compile all 'contribs')

If I run:

    (mp:all-processes)

it lists the running "SLIME-listener" process, so it seems to work...

Thanks for any help!

Paul




Reply via email to