In my web-app server keeps the list of all the nodes that are connected to it (in the database). Just to ensure that it doesn't keep the node information that are not connected to it anymore,after a certain interval it deletes the node from the database. Each node connected pings to the server after every 10 seconds and there is an entry made, that this particular node pinged the server at this time.
Problem :
Please help me with some inputs, as to how should I manage this ? If I make a time stamp, like :
new GregorianCalendar().getTimeInMillis();
after every 10 seconds on the server how should the server check,if the time stamp is 5 minutes old or not ? Or may be there is an all together another way.
boolean isOld = System.currentTimeMillis() = someDate.getTime() > 300000; // 5 mins in ms
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.