From 432b02e3152ba714a3b5a24e1ad137a51819fec2 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Fri, 25 May 2001 10:51:26 +0000 Subject: Added a timeout for connection attempts. --- ncpd/socketchan.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ncpd/socketchan.cc') diff --git a/ncpd/socketchan.cc b/ncpd/socketchan.cc index 1eba086..5d13090 100644 --- a/ncpd/socketchan.cc +++ b/ncpd/socketchan.cc @@ -148,6 +148,7 @@ ncpConnectNak() ncpConnectTerminate(); else { connectTry++; + tryStamp = time(0); ncpRegister(); } } @@ -202,6 +203,7 @@ socketPoll() // other cases, we first perform a registration. Connect // is then triggered by RegisterAck and uses the name // we received from the Psion. + tryStamp = time(0); if (strncmp(registerName, "SYS$RFSV", 8) == 0) ncpConnect(); else @@ -220,7 +222,8 @@ socketPoll() } else if (res == 1) { ncpSend(a); } - } + } else if (time(0) > (tryStamp + 15)) + terminateWhenAsked(); } bool socketChan:: -- cgit v1.2.3