By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,955 Members | 1,275 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,955 IT Pros & Developers. It's quick & easy.

How can I have an object delete itself after X seconds?

P: 1
I'm trying to write a DNS server and I need the IP/name mappings to delete themselves after a given number of seconds. How can I accomplish that?

Thank you
Nov 12 '08 #1
Share this Question
Share on Google+
1 Reply


100+
P: 424
For waiting x seconds, you can use functions in ctime (time.h in C). For deleting, it depends how your mappings are stored. E.g. if you're using an STL map, then use the erase() method to delete elements.
Nov 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.