diff options
author | Fritz Elfert <felfert@to.com> | 2001-05-25 10:51:26 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2001-05-25 10:51:26 +0000 |
commit | 432b02e3152ba714a3b5a24e1ad137a51819fec2 (patch) | |
tree | b8593bbae37807828157fd0c7e7ef7fbca715adf /ncpd/socketchan.cc | |
parent | 4a35a3fb7d0e30aa4c3d4b91efa890cbf4096c97 (diff) | |
download | plptools-432b02e3152ba714a3b5a24e1ad137a51819fec2.tar.gz plptools-432b02e3152ba714a3b5a24e1ad137a51819fec2.tar.bz2 plptools-432b02e3152ba714a3b5a24e1ad137a51819fec2.zip |
Added a timeout for connection attempts.
Diffstat (limited to 'ncpd/socketchan.cc')
-rw-r--r-- | ncpd/socketchan.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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:: |