9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Xiao-Yong Jin <meta.jxy@gmail.com>
To: 9front@9front.org
Subject: [9front] rconnect via aan reliability patch
Date: Mon, 30 Aug 2021 17:24:31 -0500	[thread overview]
Message-ID: <6C770927-6695-4440-B1D2-4C42B9EADE43@gmail.com> (raw)

With long distance or slow network, the aanclient in rconnect
occasionally could fail to read the aan address sent by aanserver
with error:

	read: error reading <stdin>: i/o on hungup channel

This patch adds an additional synchronization by sending a message
from aanclient back to aanserver.

diff 61f37abf576a02c7f1e3561cfaba3c0457f55c9d uncommitted
--- a//rc/bin/rconnect
+++ b//rc/bin/rconnect
@@ -50,11 +50,12 @@
 	fn aanserver {
 		~ $#netdir 1 || netdir=/net/tcp/clone
 		netdir=`{basename -d $netdir} || exit
-		<>$netdir/clone {
-			netdir=$netdir/`{read} || exit
+		<>[4]$netdir/clone {
+			netdir=$netdir/`{read <[0=4]} || exit
 			>[3] $netdir/ctl {
 				echo -n 'announce *!0' >[1=3]
 				echo `{cat $netdir/local} || exit
+				~ `{read} OK || exit
 				bind '#|' /mnt/aan || exit
 				exec aan -m $aanto $netdir <>/mnt/aan/data1 >[1=0] >[2]/dev/null &
 			}
@@ -72,7 +73,7 @@
 	}
 	fn aanclient {
 		host=`{echo $host | sed 's/(.*)!([^!]+)$/\1/'}^!^`{read | sed 's/(.*)!([^!]+)$/\2/'} || exit
+		echo OK || exit
 		tlsclient -a -o <>{rfork s; aan -m $aanto -c $host >[1=0]} /bin/rc -c 'sendscript $*' $*
 	}
 	exec $argv0 -k $"keyspec $host <{builtin whatis aanserver; pvar aanto; echo aanserver} aanclient $*


             reply	other threads:[~2021-08-31  9:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 22:24 Xiao-Yong Jin [this message]
2021-08-31  7:55 ` cinap_lenrek
2021-08-31 18:38   ` Xiao-Yong Jin
2021-09-01  1:20     ` cinap_lenrek
2021-09-06 14:58       ` mrowczok
2021-09-06 16:23         ` cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6C770927-6695-4440-B1D2-4C42B9EADE43@gmail.com \
    --to=meta.jxy@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).