From f8ae8d2741361efbbfafe0ab1f296a58d48bfa99 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 7 Nov 2012 14:26:07 -0800 Subject: [PATCH] Periodically flush buffered console mux data. This is necessary to cover the situation when data was buffered and sending data out the connection stalled due to OS/network buffering and no more output traffic happens to be generated. --- sim_console.c | 2 ++ sim_tmxr.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sim_console.c b/sim_console.c index 3ab9029e..f1fb5354 100644 --- a/sim_console.c +++ b/sim_console.c @@ -185,6 +185,8 @@ if (sim_con_tmxr.master == 0) /* not Telnet? done */ if (tmxr_poll_conn (&sim_con_tmxr) >= 0) /* poll connect */ sim_con_ldsc.rcve = 1; /* rcv enabled */ sim_activate_after(uptr, 1000000); /* check again in 1 second */ +if (sim_con_ldsc.xmte == 0) /* xmt disabled? */ + tmxr_send_buffered_data (&sim_con_ldsc); /* try to flush buffered data */ return SCPE_OK; } diff --git a/sim_tmxr.c b/sim_tmxr.c index 0637489b..7da4b16a 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -850,6 +850,7 @@ if (lp->serport) { free (lp->serconfig); lp->serconfig = NULL; lp->cnms = 0; + lp->rcve = lp->xmte = 0; } else if (!lp->mp->modem_control) { /* serial connection? */ @@ -862,6 +863,7 @@ else /* Telnet connection */ if (lp->conn) { sim_close_sock (lp->conn, 0); /* close socket */ lp->conn = 0; + lp->rcve = lp->xmte = 0; } free(lp->ipad); lp->ipad = NULL;