9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] rconnect via aan reliability patch
@ 2021-08-30 22:24 Xiao-Yong Jin
  2021-08-31  7:55 ` cinap_lenrek
  0 siblings, 1 reply; 6+ messages in thread
From: Xiao-Yong Jin @ 2021-08-30 22:24 UTC (permalink / raw)
  To: 9front

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 $*


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-06 16:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 22:24 [9front] rconnect via aan reliability patch Xiao-Yong Jin
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

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).