Re: What are port requirements for remote lisp?

Mirko Vukovic <[email protected]> Thu, 2 Apr 2020 14:16:55 -0400
Newsgroups gmane.lisp.slime.devel
Message-ID <CAO73BACmO-+rSwj9b3gLGEuNtRjypk2Eq2-ZYmD-SMN=USRi6g@mail.gmail.com>
--0000000000007f75ab05a252d0bc
Content-Type: text/plain; charset="UTF-8"

On Thu, Apr 2, 2020 at 9:09 AM Martin Simmons <[email protected]> wrote:

> >>>>> On Thu, 2 Apr 2020 08:33:42 -0400, Mirko Vukovic said:
> >
> > On Thu, Apr 2, 2020 at 7:55 AM Martin Simmons <[email protected]>
> wrote:
> >
> > > >>>>> On Wed, 1 Apr 2020 08:59:30 -0400, Mirko Vukovic said:
> > > >
> > > > On Tue, Mar 31, 2020 at 11:51 AM Martin Simmons <
> [email protected]>
> > > > wrote:
> > > >
> > > > > >>>>> On Mon, 30 Mar 2020 21:16:00 -0400, Mirko Vukovic said:
> > > > > >
> > > > > > Hello,
> > > > > >
> > > > > > My setup is Sly on Spacemacs with Windows 10 running remote lisp
> on
> > > Linux
> > > > > > over a corporate network. I have not found a Sly mailing list,
> and I
> > > > > hope I
> > > > > > can get an answer here.
> > > > > >
> > > > > > Emacs is running Sly on Spacemacs on Windows 10. Lisp is running
> on a
> > > > > Linux
> > > > > > server. But Sly does not connect to the listening Lisp. Corporate
> > > network
> > > > > > security policies have changed. I can ask for IT to accommodate
> me,
> > > but
> > > > > > first I need to know what to ask for.
> > > > > >
> > > > > > So far, I have opened a tunnel, and started a listening lisp
> (details
> > > > > > below).
> > > > > >
> > > > > > In Emacs I get:
> > > > > >
> > > > > > sly-connect RET RET RET
> > > > > > [sly] Connecting to Slynk on port 4005..
> > > > > > helm-M-x-execute-command: make client process failed: Connection
> > > timed
> > > > > out,
> > > > > > :name, sly-9, :buffer, nil, :host, hal9000, :service, 4005,
> :nowait,
> > > nil,
> > > > > > :tls-parameters, nil
> > > > > >
> > > > > > The session transcript:
> > > > > > > ssh -L4005:localhost:4005 mirko@hal9000
> > > > > >
> > > > > > [mirko@hal9000 .roswell]$ ros -L ccl-bin run --load
> > > > > start-slynk-server.lisp
> > > > > >
> > > > > >  Added SLYNK path to ASDF:*CENTRAL-REGISTRY*
> > > > > > SLYNK's ASDF loader finished.
> > > > > >  Loaded ASDF system
> > > > > > ;; Slynk started at port: 4005.
> > > > > >
> > > > > >  Created SLYNK server on port 4005
> > > > > >  Set *USE-DEDICATED-OUTPUT-STREAM* to NIL
> > > > > > Clozure Common Lisp Version 1.11.5/v1.11.5  (LinuxX8664)
> > > > > >
> > > > > > For more information about CCL, please see
> http://ccl.clozure.com.
> > > > > >
> > > > > > CCL is free software.  It is distributed under the terms of the
> > > Apache
> > > > > > Licence, Version 2.0.
> > > > > > ?
> > > > > >
> > > > > > My question is as follows:
> > > > > >
> > > > > >    1. Do I need bi-directional traffic on 4005?
> > > > >
> > > > > Assuming you are using the ssh tunnel above, then you don't need
> port
> > > 4005
> > > > > traffic on the LAN (it is all hidden in the tunnel).
> > > > >
> > > > > The most likely problem is that some firewall on the Windows
> machine is
> > > > > blocking port 4005.  You may need to configure that firewall to
> allow
> > > ssh
> > > > > to
> > > > > listen on localhost:4005 and/or to accept connections to it from
> > > Spacemacs.
> > > > > In theory you might have similar localhost firewall issues on
> hal9000,
> > > but
> > > > > that is less likely.
> > > > >
> > > > >
> > > > > >    2. Do I need bi-directional traffic on 22? (after recent
> changes I
> > > > > >    cannot ssh or scp into my Windows machine)
> > > > >
> > > > > I'm assuming that you ran the ssh command on the Windows 10 machine
> > > and it
> > > > > gave you a working login to hal9000.  If so, then it looks like you
> > > already
> > > > > have what you need for port 22.
> > > > >
> > > >
> > > > Yes, I can log in to hal9000 with the -L switch:
> > > >
> > > > > ssh -L4005:localhost:4005 mirko@hal9000
> > > > Last login: Thu Mar 19 14:33:17 2020 from 172.27.236.189
> > > > [mirko@hal9000 ~]$
> > > >
> > > >
> > > > >
> > > > > Note that bi-directional traffic on a connected socket is different
> > > from
> > > > > whether you can make a connection in both directions.
> > > > >
> > > > >
> > > > > >    3. What tools can I use to try to narrow down the cause of the
> > > > > problem?
> > > > > >    For instance, can I send a command to the lisp image, and see
> its
> > > > > effects
> > > > > >    on the lisp side?
> > > > >
> > > > > Firstly, run "netstat -antp" on hal9000 to see if Lisp is
> listening on
> > > port
> > > > > 4005.
> > > > >
> > > >
> > > > It looks that ccl-bin is listening:
> > > > $ sudo netstat -antp | grep :4005
> > > > tcp        0      0 127.0.0.1:4005          0.0.0.0:*
> > >  LISTEN
> > > >      104461/lx86cl64
> > > >
> > > >
> > > > >
> > > > > Secondly, run "netstat -anop tcp" on the Windows 10 machine to see
> if
> > > ssh
> > > > > is
> > > > > listening on port 4005.
> > > > >
> > > > >
> > > > I have Msys2's netstat. On the laptop:
> > > > > which netstat
> > > > /c/WINDOWS/system32/netstat
> > > > /c/Users/mirko/Downloads
> > > > > netstat -anop tcp | grep :4005
> > > >   TCP    127.0.0.1:4005         0.0.0.0:0              LISTENING
> > >  12052
> > >
> > > Yes, both netstat outputs look good at that point.
> > >
> > >
> > > > > Thirdly, run "ssh -p 4005 localhost" on the Windows 10 machine.
> This
> > > use a
> > > > > ssh is very bogus, but it should at least give an error message
> with
> > > some
> > > > > diagnostics.  (Normally I would use telnet for this, but it is not
> > > > > installed
> > > > > on Windows 10 by default.)
> > > > >
> > > >
> > > > Outputs of both ssh and telnet on the laptop:
> > > > > which telnet
> > > > /usr/bin/telnet
> > > > /c/Users/mirko/Downloads
> > > > > telnet localhost 4005
> > > > Trying ::1...
> > > > Connected to localhost.
> > > > Escape character is '^]'.
> > > > Connection closed by foreign host.
> > >
> > > OK, so it is connected to the Windows side at least.
> > >
> > > Check that the Slynk server was created with :dont-close t (or set
> > > slynk:*dont-close* to t before creating it).  If dont-close is nil, it
> will
> > > only accept one connection, which makes debugging difficult.
> > >
> > > Then restart the log in to hal9000 with -v option to ssh to make it
> print
> > > debug
> > > information:
> > >
> > > ssh -v -L4005:localhost:4005 mirko@hal9000
> > >
> > > and try the telnet again to see what is happening at the Linux end.
> > >
> > > __Martin
> > >
> > Here is the test log. Telnet and ssh debug are at the bottom.
> > 1 Start slynk with :dont-close t
> >
> > Modified startup script:
> >
> > (let ((port 4005))
> >     (slynk:create-server :port port :dont-close t)
> >     (format t "~% Created SLYNK server on port ~a" port))
> > (setf slynk:*use-dedicated-output-stream* nil)
> >
> > 2 Started tunnel with verbose option, -v switch
> >
> > $ ssh -v -L4005:hal9000:4005 mirko@hal9000
> >
> > 3 Telnet on laptop side to laptop port 4005
> >
> > @laptop> telnet localhost 4005
> > Trying ::1...
> > Connected to localhost.
> > Escape character is '^]'.
> > Connection closed by foreign host.
> >
> > 4 SSH debug output
> >
> > @hal9000> debug1: Connection to port 4005 forwarding to hal9000 port
> > 4005 requested.
> > debug1: channel 3: new [direct-tcpip]
> > channel 3: open failed: connect failed: Connection refused
> > debug1: channel 3: free: direct-tcpip: listening port 4005 for hal9000
> > port 4005, connect from ::1 port 64100 to ::1 port 4005, nchannels 4
>
> It looks like hal9000 is resolving to the IPv6 localhost address ::1 on
> hal9000, but the Lisp is probably only listening on IPv4.
>
> Try restarting the tunnel with -L4005:127.0.0.1:4005 to force IPv4.
>
> __Martin
>

I restarted tunnel with IPv4: Now when I type something in the telnet
session, I get Lisp to respond (with debugger in this case). Sly is still
not connecting - maybe I need to restart emacs.

Log:
1 Start slynk with :dont-close t as before
2 Start tunnel with verbose option, -v switch and IPv4

$ ssh -v -L4005:127.0.0.1:4005 977315@hal9000

3 Telnet on laptop side to laptop port 4005

@laptop> telnet localhost 4005
Trying ::1...
Connected to localhost.
Escape character is '^]'.

3.1 SSH debug output to telnet start

debug1: Connection to port 4005 forwarding to 127.0.0.1 port 4005 requested.
debug1: channel 3: new [direct-tcpip]

4 Send command via telnet session

Using telnet session send command:

*features*
Connection closed by foreign host.

4.1 Results in an error in lisp due to syntax error

;; slynk:close-connection: Not an integer string: "*featu"
;; closing 0 channels
;; closing 0 listeners
;; Event history start:
decode-message
close-connection: Not an integer string: "\x00FF\x00F4\x00FF\x00FD\x00FF" ...
close-connection Not an integer string:
"\x00FF\x00F4\x00FF\x00FD\x00FF" ... done.
decode-message
close-connection: Not an integer string: "*featu" ...
;; Event history end.
;; Backtrace:
0: (NIL #<Unknown Arguments>)
1: (NIL #<Unknown Arguments>)
2: (SLYNK-BACKEND:CALL-WITH-DEBUGGING-ENVIRONMENT #<Compiled-function
(:INTERNAL SLYNK::SAFE-BACKTRACE) (Non-Global)  #x302000A0BFFF>)
3: (SLYNK::SAFE-BACKTRACE)
4: (SLYNK::SIGNAL-SLYNK-ERROR #<CCL::PARSE-INTEGER-NOT-INTEGER-STRING
#x302000C1F32D> NIL)
5: (SIGNAL #<CCL::PARSE-INTEGER-NOT-INTEGER-STRING #x302000C1F32D>)
6: (CCL::%ERROR #<CCL::PARSE-INTEGER-NOT-INTEGER-STRING
#x302000C1F32D> (:STRING "*featu") 5975725205395)
7: (PARSE-INTEGER "*featu" :START 0 :END 6 :RADIX 16 :JUNK-ALLOWED NIL)
8: (SLYNK-RPC:READ-PACKET #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4)
#x302000BDFD9D>)
9: (SLYNK-RPC:READ-MESSAGE #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4)
#x302000BDFD9D> #<Package "SLYNK-IO-PACKAGE">)
10: (SLYNK::DECODE-MESSAGE #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4)
#x302000BDFD9D>)
11: (SLYNK::READ-LOOP #<MULTITHREADED-CONNECTION #x302000BDEFCD>)
12: (CCL::RUN-PROCESS-INITIAL-FORM #<PROCESS reader-thread(9) [Active]
#x302000BFEFBD> (#<COMPILED-LEXICAL-CLOSURE (:INTERNAL
CCL::%PROCESS-RUN-FUNCTION) #x302000BFED2F>))
13: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (PROCESS))) #<PROCESS
reader-thread(9) [Active] #x302000BFEFBD> (#<COMPILED-LEXICAL-CLOSURE
(:INTERNAL CCL::%PROCESS-RUN-FUNCTION) #x302000BFED2F>))
14: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))
;; Connection to Emacs lost. [
;;  condition: Not an integer string: "*featu"
;;  type: CCL::PARSE-INTEGER-NOT-INTEGER-STRING
;;  style: :SPAWN]

--0000000000007f75ab05a252d0bc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Apr 2, 2020 at 9:09 AM Martin=
 Simmons &lt;<a href=3D"mailto:[email protected]">[email protected]</=
a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&g=
t;&gt;&gt;&gt;&gt; On Thu, 2 Apr 2020 08:33:42 -0400, Mirko Vukovic said:<b=
r>
&gt; <br>
&gt; On Thu, Apr 2, 2020 at 7:55 AM Martin Simmons &lt;<a href=3D"mailto:ma=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<b=
r>
&gt; <br>
&gt; &gt; &gt;&gt;&gt;&gt;&gt; On Wed, 1 Apr 2020 08:59:30 -0400, Mirko Vuk=
ovic said:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Tue, Mar 31, 2020 at 11:51 AM Martin Simmons &lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>=
&gt;<br>
&gt; &gt; &gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;&gt;&gt;&gt;&gt; On Mon, 30 Mar 2020 21:16:00 -0400=
, Mirko Vukovic said:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Hello,<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; My setup is Sly on Spacemacs with Windows 10 runni=
ng remote lisp on<br>
&gt; &gt; Linux<br>
&gt; &gt; &gt; &gt; &gt; over a corporate network. I have not found a Sly m=
ailing list, and I<br>
&gt; &gt; &gt; &gt; hope I<br>
&gt; &gt; &gt; &gt; &gt; can get an answer here.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Emacs is running Sly on Spacemacs on Windows 10. L=
isp is running on a<br>
&gt; &gt; &gt; &gt; Linux<br>
&gt; &gt; &gt; &gt; &gt; server. But Sly does not connect to the listening =
Lisp. Corporate<br>
&gt; &gt; network<br>
&gt; &gt; &gt; &gt; &gt; security policies have changed. I can ask for IT t=
o accommodate me,<br>
&gt; &gt; but<br>
&gt; &gt; &gt; &gt; &gt; first I need to know what to ask for.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; So far, I have opened a tunnel, and started a list=
ening lisp (details<br>
&gt; &gt; &gt; &gt; &gt; below).<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; In Emacs I get:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; sly-connect RET RET RET<br>
&gt; &gt; &gt; &gt; &gt; [sly] Connecting to Slynk on port 4005..<br>
&gt; &gt; &gt; &gt; &gt; helm-M-x-execute-command: make client process fail=
ed: Connection<br>
&gt; &gt; timed<br>
&gt; &gt; &gt; &gt; out,<br>
&gt; &gt; &gt; &gt; &gt; :name, sly-9, :buffer, nil, :host, hal9000, :servi=
ce, 4005, :nowait,<br>
&gt; &gt; nil,<br>
&gt; &gt; &gt; &gt; &gt; :tls-parameters, nil<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The session transcript:<br>
&gt; &gt; &gt; &gt; &gt; &gt; ssh -L4005:localhost:4005 mirko@hal9000<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; [mirko@hal9000 .roswell]$ ros -L ccl-bin run --loa=
d<br>
&gt; &gt; &gt; &gt; start-slynk-server.lisp<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 Added SLYNK path to ASDF:*CENTRAL-REGISTRY*<=
br>
&gt; &gt; &gt; &gt; &gt; SLYNK&#39;s ASDF loader finished.<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 Loaded ASDF system<br>
&gt; &gt; &gt; &gt; &gt; ;; Slynk started at port: 4005.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 Created SLYNK server on port 4005<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 Set *USE-DEDICATED-OUTPUT-STREAM* to NIL<br>
&gt; &gt; &gt; &gt; &gt; Clozure Common Lisp Version 1.11.5/v1.11.5=C2=A0 (=
LinuxX8664)<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; For more information about CCL, please see <a href=
=3D"http://ccl.clozure.com" rel=3D"noreferrer" target=3D"_blank">http://ccl=
.clozure.com</a>.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; CCL is free software.=C2=A0 It is distributed unde=
r the terms of the<br>
&gt; &gt; Apache<br>
&gt; &gt; &gt; &gt; &gt; Licence, Version 2.0.<br>
&gt; &gt; &gt; &gt; &gt; ?<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; My question is as follows:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 1. Do I need bi-directional traffic o=
n 4005?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Assuming you are using the ssh tunnel above, then you d=
on&#39;t need port<br>
&gt; &gt; 4005<br>
&gt; &gt; &gt; &gt; traffic on the LAN (it is all hidden in the tunnel).<br=
>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; The most likely problem is that some firewall on the Wi=
ndows machine is<br>
&gt; &gt; &gt; &gt; blocking port 4005.=C2=A0 You may need to configure tha=
t firewall to allow<br>
&gt; &gt; ssh<br>
&gt; &gt; &gt; &gt; to<br>
&gt; &gt; &gt; &gt; listen on localhost:4005 and/or to accept connections t=
o it from<br>
&gt; &gt; Spacemacs.<br>
&gt; &gt; &gt; &gt; In theory you might have similar localhost firewall iss=
ues on hal9000,<br>
&gt; &gt; but<br>
&gt; &gt; &gt; &gt; that is less likely.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 2. Do I need bi-directional traffic o=
n 22? (after recent changes I<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 cannot ssh or scp into my Windows mac=
hine)<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I&#39;m assuming that you ran the ssh command on the Wi=
ndows 10 machine<br>
&gt; &gt; and it<br>
&gt; &gt; &gt; &gt; gave you a working login to hal9000.=C2=A0 If so, then =
it looks like you<br>
&gt; &gt; already<br>
&gt; &gt; &gt; &gt; have what you need for port 22.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Yes, I can log in to hal9000 with the -L switch:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; ssh -L4005:localhost:4005 mirko@hal9000<br>
&gt; &gt; &gt; Last login: Thu Mar 19 14:33:17 2020 from 172.27.236.189<br>
&gt; &gt; &gt; [mirko@hal9000 ~]$<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Note that bi-directional traffic on a connected socket =
is different<br>
&gt; &gt; from<br>
&gt; &gt; &gt; &gt; whether you can make a connection in both directions.<b=
r>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 3. What tools can I use to try to nar=
row down the cause of the<br>
&gt; &gt; &gt; &gt; problem?<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 For instance, can I send a command to=
 the lisp image, and see its<br>
&gt; &gt; &gt; &gt; effects<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 on the lisp side?<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Firstly, run &quot;netstat -antp&quot; on hal9000 to se=
e if Lisp is listening on<br>
&gt; &gt; port<br>
&gt; &gt; &gt; &gt; 4005.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; It looks that ccl-bin is listening:<br>
&gt; &gt; &gt; $ sudo netstat -antp | grep :4005<br>
&gt; &gt; &gt; tcp=C2=A0 =C2=A0 =C2=A0 =C2=A0 0=C2=A0 =C2=A0 =C2=A0 0 <a hr=
ef=3D"http://127.0.0.1:4005" rel=3D"noreferrer" target=3D"_blank">127.0.0.1=
:4005</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0.0.0.0:*<br>
&gt; &gt;=C2=A0 LISTEN<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 104461/lx86cl64<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Secondly, run &quot;netstat -anop tcp&quot; on the Wind=
ows 10 machine to see if<br>
&gt; &gt; ssh<br>
&gt; &gt; &gt; &gt; is<br>
&gt; &gt; &gt; &gt; listening on port 4005.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; I have Msys2&#39;s netstat. On the laptop:<br>
&gt; &gt; &gt; &gt; which netstat<br>
&gt; &gt; &gt; /c/WINDOWS/system32/netstat<br>
&gt; &gt; &gt; /c/Users/mirko/Downloads<br>
&gt; &gt; &gt; &gt; netstat -anop tcp | grep :4005<br>
&gt; &gt; &gt;=C2=A0 =C2=A0TCP=C2=A0 =C2=A0 <a href=3D"http://127.0.0.1:400=
5" rel=3D"noreferrer" target=3D"_blank">127.0.0.1:4005</a>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0<a href=3D"http://0.0.0.0:0" rel=3D"noreferrer" target=3D"=
_blank">0.0.0.0:0</a>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LISTE=
NING<br>
&gt; &gt;=C2=A0 12052<br>
&gt; &gt;<br>
&gt; &gt; Yes, both netstat outputs look good at that point.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; &gt; Thirdly, run &quot;ssh -p 4005 localhost&quot; on the W=
indows 10 machine.=C2=A0 This<br>
&gt; &gt; use a<br>
&gt; &gt; &gt; &gt; ssh is very bogus, but it should at least give an error=
 message with<br>
&gt; &gt; some<br>
&gt; &gt; &gt; &gt; diagnostics.=C2=A0 (Normally I would use telnet for thi=
s, but it is not<br>
&gt; &gt; &gt; &gt; installed<br>
&gt; &gt; &gt; &gt; on Windows 10 by default.)<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Outputs of both ssh and telnet on the laptop:<br>
&gt; &gt; &gt; &gt; which telnet<br>
&gt; &gt; &gt; /usr/bin/telnet<br>
&gt; &gt; &gt; /c/Users/mirko/Downloads<br>
&gt; &gt; &gt; &gt; telnet localhost 4005<br>
&gt; &gt; &gt; Trying ::1...<br>
&gt; &gt; &gt; Connected to localhost.<br>
&gt; &gt; &gt; Escape character is &#39;^]&#39;.<br>
&gt; &gt; &gt; Connection closed by foreign host.<br>
&gt; &gt;<br>
&gt; &gt; OK, so it is connected to the Windows side at least.<br>
&gt; &gt;<br>
&gt; &gt; Check that the Slynk server was created with :dont-close t (or se=
t<br>
&gt; &gt; slynk:*dont-close* to t before creating it).=C2=A0 If dont-close =
is nil, it will<br>
&gt; &gt; only accept one connection, which makes debugging difficult.<br>
&gt; &gt;<br>
&gt; &gt; Then restart the log in to hal9000 with -v option to ssh to make =
it print<br>
&gt; &gt; debug<br>
&gt; &gt; information:<br>
&gt; &gt;<br>
&gt; &gt; ssh -v -L4005:localhost:4005 mirko@hal9000<br>
&gt; &gt;<br>
&gt; &gt; and try the telnet again to see what is happening at the Linux en=
d.<br>
&gt; &gt;<br>
&gt; &gt; __Martin<br>
&gt; &gt;<br>
&gt; Here is the test log. Telnet and ssh debug are at the bottom.<br>
&gt; 1 Start slynk with :dont-close t<br>
&gt; <br>
&gt; Modified startup script:<br>
&gt; <br>
&gt; (let ((port 4005))<br>
&gt;=C2=A0 =C2=A0 =C2=A0(slynk:create-server :port port :dont-close t)<br>
&gt;=C2=A0 =C2=A0 =C2=A0(format t &quot;~% Created SLYNK server on port ~a&=
quot; port))<br>
&gt; (setf slynk:*use-dedicated-output-stream* nil)<br>
&gt; <br>
&gt; 2 Started tunnel with verbose option, -v switch<br>
&gt; <br>
&gt; $ ssh -v -L4005:hal9000:4005 mirko@hal9000<br>
&gt; <br>
&gt; 3 Telnet on laptop side to laptop port 4005<br>
&gt; <br>
&gt; @laptop&gt; telnet localhost 4005<br>
&gt; Trying ::1...<br>
&gt; Connected to localhost.<br>
&gt; Escape character is &#39;^]&#39;.<br>
&gt; Connection closed by foreign host.<br>
&gt; <br>
&gt; 4 SSH debug output<br>
&gt; <br>
&gt; @hal9000&gt; debug1: Connection to port 4005 forwarding to hal9000 por=
t<br>
&gt; 4005 requested.<br>
&gt; debug1: channel 3: new [direct-tcpip]<br>
&gt; channel 3: open failed: connect failed: Connection refused<br>
&gt; debug1: channel 3: free: direct-tcpip: listening port 4005 for hal9000=
<br>
&gt; port 4005, connect from ::1 port 64100 to ::1 port 4005, nchannels 4<b=
r>
<br>
It looks like hal9000 is resolving to the IPv6 localhost address ::1 on<br>
hal9000, but the Lisp is probably only listening on IPv4.<br>
<br>
Try restarting the tunnel with -L4005:<a href=3D"http://127.0.0.1:4005" rel=
=3D"noreferrer" target=3D"_blank">127.0.0.1:4005</a> to force IPv4.<br>
<br>
__Martin<br></blockquote><div><br></div><div>I restarted tunnel with IPv4: =
Now when I type something in the telnet session, I get Lisp to respond (wit=
h debugger in this case). Sly is still not connecting - maybe I need to res=
tart emacs.</div><div><br></div><div>Log:</div><div><div id=3D"gmail-conten=
t" style=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;font-s=
ize:medium"><div id=3D"gmail-outline-container-org2d6c770" class=3D"gmail-o=
utline-2"><h2 id=3D"gmail-org2d6c770"><span class=3D"gmail-section-number-2=
">1</span>=C2=A0Start slynk with=C2=A0<code>:dont-close t</code>=C2=A0as be=
fore</h2></div><div id=3D"gmail-outline-container-orgc94a94d" class=3D"gmai=
l-outline-2"><h2 id=3D"gmail-orgc94a94d"><span class=3D"gmail-section-numbe=
r-2">2</span>=C2=A0Start tunnel with verbose option,=C2=A0<code>-v</code>=
=C2=A0switch and IPv4</h2><div class=3D"gmail-outline-text-2" id=3D"gmail-t=
ext-2"><pre class=3D"example" style=3D"border:1px solid rgb(204,204,204);pa=
dding:8pt;overflow:auto;margin:1.2em">$ ssh -v -L4005:<a href=3D"http://127=
.0.0.1:4005">127.0.0.1:4005</a> 977315@hal9000
</pre></div></div><div id=3D"gmail-outline-container-org959bd82" class=3D"g=
mail-outline-2"><h2 id=3D"gmail-org959bd82"><span class=3D"gmail-section-nu=
mber-2">3</span>=C2=A0Telnet on laptop side to laptop port 4005</h2><div cl=
ass=3D"gmail-outline-text-2" id=3D"gmail-text-3"><pre class=3D"example" sty=
le=3D"border:1px solid rgb(204,204,204);padding:8pt;overflow:auto;margin:1.=
2em">@laptop&gt; telnet localhost 4005
Trying ::1...
Connected to localhost.
Escape character is &#39;^]&#39;.
</pre></div><div id=3D"gmail-outline-container-org9fd5e73" class=3D"gmail-o=
utline-3"><h3 id=3D"gmail-org9fd5e73"><span class=3D"gmail-section-number-3=
">3.1</span>=C2=A0SSH debug output to telnet start</h3><div class=3D"gmail-=
outline-text-3" id=3D"gmail-text-3-1"><pre class=3D"example" style=3D"borde=
r:1px solid rgb(204,204,204);padding:8pt;overflow:auto;margin:1.2em">debug1=
: Connection to port 4005 forwarding to 127.0.0.1 port 4005 requested.
debug1: channel 3: new [direct-tcpip]
</pre></div></div></div><div id=3D"gmail-outline-container-org3943f79" clas=
s=3D"gmail-outline-2"><h2 id=3D"gmail-org3943f79"><span class=3D"gmail-sect=
ion-number-2">4</span>=C2=A0Send command via=C2=A0<code>telnet</code>=C2=A0=
session</h2><div class=3D"gmail-outline-text-2" id=3D"gmail-text-4"><p>Usin=
g=C2=A0<code>telnet</code>=C2=A0session send command:</p><pre class=3D"exam=
ple" style=3D"border:1px solid rgb(204,204,204);padding:8pt;overflow:auto;m=
argin:1.2em">*features*
Connection closed by foreign host.
</pre></div><div id=3D"gmail-outline-container-org0ef4685" class=3D"gmail-o=
utline-3"><h3 id=3D"gmail-org0ef4685"><span class=3D"gmail-section-number-3=
">4.1</span>=C2=A0Results in an error in lisp due to syntax error</h3><div =
class=3D"gmail-outline-text-3" id=3D"gmail-text-4-1"><pre class=3D"example"=
 style=3D"border:1px solid rgb(204,204,204);padding:8pt;overflow:auto;margi=
n:1.2em">;; slynk:close-connection: Not an integer string: &quot;*featu&quo=
t;
;; closing 0 channels
;; closing 0 listeners
;; Event history start:
decode-message
close-connection: Not an integer string: &quot;\x00FF\x00F4\x00FF\x00FD\x00=
FF&quot; ...
close-connection Not an integer string: &quot;\x00FF\x00F4\x00FF\x00FD\x00F=
F&quot; ... done.
decode-message
close-connection: Not an integer string: &quot;*featu&quot; ...
;; Event history end.
;; Backtrace:
0: (NIL #&lt;Unknown Arguments&gt;)
1: (NIL #&lt;Unknown Arguments&gt;)
2: (SLYNK-BACKEND:CALL-WITH-DEBUGGING-ENVIRONMENT #&lt;Compiled-function (:=
INTERNAL SLYNK::SAFE-BACKTRACE) (Non-Global)  #x302000A0BFFF&gt;)
3: (SLYNK::SAFE-BACKTRACE)
4: (SLYNK::SIGNAL-SLYNK-ERROR #&lt;CCL::PARSE-INTEGER-NOT-INTEGER-STRING #x=
302000C1F32D&gt; NIL)
5: (SIGNAL #&lt;CCL::PARSE-INTEGER-NOT-INTEGER-STRING #x302000C1F32D&gt;)
6: (CCL::%ERROR #&lt;CCL::PARSE-INTEGER-NOT-INTEGER-STRING #x302000C1F32D&g=
t; (:STRING &quot;*featu&quot;) 5975725205395)
7: (PARSE-INTEGER &quot;*featu&quot; :START 0 :END 6 :RADIX 16 :JUNK-ALLOWE=
D NIL)
8: (SLYNK-RPC:READ-PACKET #&lt;BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4) #x302=
000BDFD9D&gt;)
9: (SLYNK-RPC:READ-MESSAGE #&lt;BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4) #x30=
2000BDFD9D&gt; #&lt;Package &quot;SLYNK-IO-PACKAGE&quot;&gt;)
10: (SLYNK::DECODE-MESSAGE #&lt;BASIC-TCP-STREAM ISO-8859-1 (SOCKET/4) #x30=
2000BDFD9D&gt;)
11: (SLYNK::READ-LOOP #&lt;MULTITHREADED-CONNECTION #x302000BDEFCD&gt;)
12: (CCL::RUN-PROCESS-INITIAL-FORM #&lt;PROCESS reader-thread(9) [Active] #=
x302000BFEFBD&gt; (#&lt;COMPILED-LEXICAL-CLOSURE (:INTERNAL CCL::%PROCESS-R=
UN-FUNCTION) #x302000BFED2F&gt;))
13: ((:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL (PROCESS))) #&lt;PROCESS rea=
der-thread(9) [Active] #x302000BFEFBD&gt; (#&lt;COMPILED-LEXICAL-CLOSURE (:=
INTERNAL CCL::%PROCESS-RUN-FUNCTION) #x302000BFED2F&gt;))
14: ((:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION))
;; Connection to Emacs lost. [
;;  condition: Not an integer string: &quot;*featu&quot;
;;  type: CCL::PARSE-INTEGER-NOT-INTEGER-STRING
;;  style: :SPAWN]
</pre></div></div></div></div><div id=3D"gmail-postamble" class=3D"gmail-st=
atus" style=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;fon=
t-size:medium"><p class=3D"gmail-date" style=3D"font-size:14.4px;margin:0.2=
em"><br></p></div></div></div></div>

--0000000000007f75ab05a252d0bc--