I am developing a Chat system,where i wanted to keep a list of active clients. So inorder to make sure that the client is active , i will check whether the client is active in that particular port or not.
In order to test client Activity, I considered the following:
getInputStream.read()
: I have n number of clients, so I dont want to keep threads active waiting for return statement -1.isConnected()
command is always returning true.out.checkError()
will throwException
, I dont wish to throw anyException
and get interrupted.
So I have my logic to establish connection through that port and create a file in that client machine. But i am not sure how to do it.