android - identify which clients get disconnected using java NIO -


i have created sample of java nio , created server different clients connected.

now issue want track how many clients connected on socket. example ,

if , b , c , d connected server s1 if b , c got disconnected s1 come know these clients got disconnected through java nio apis.

if client disconnects cleanly, socketchannel client become readable , read() return -1.

if connection aborted, way can detect writing , getting subsequent ioexception.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -