In comp.os.linux.development.system ligerdave <da********@gmail.comwrote:
| i wonder if anyone can help me with this. im writing a program in C
| under linux environment which can be connected to through telnet. in
| this program, i have to manage the user information peacefully under
| any circumstances. so far, if user enters quit or exit command, the
| function will clear up everything nicely. however, i ran into this
| crux that what if user terminate the telnet client or let's say in
| case the user's computer's power went off.
| so my question is very straight forward, how can i deal with cases
| like this? please help. thank you all
You will either know about it quickly or delayed. You could choose to
expedite the delayed cases by instituting your own timeout rules. But
in any case, you have to decide what to do in the case of disconnection.
You could choose to force the equivalent of logging out by causing the
same logout code to be run (and be sure it is coded to be able to deal
with the fact that the connection is no longer active). Or you could
choose to leave the user status intact, ready to be re-associationed with
a connection once the user returns. You may also choose to place a time
limit on the un-associated user state and automatically log it out if the
user does not return in sufficient time.
What is to be done needs to be decided by you when you implement this.
Or you can choose to implement a variety of choices for the administrator
to choose from. But you cannot expect us to choose for you, because if
we do, you will end up with a wide variety of different opinions and have
probably even more choices to make.
--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net /
sp**********************@ipal.net |
|------------------------------------/-------------------------------------|