java - socket.sendUrgentData doesn't work in android -
I use a thread for testing that the socket connects every 5 seconds but sendUrgentData does not work. Code is
class CheckSocketThread extension of thread {public zero run () {boolean SocketConnect = true; While (socket connect) {try {mSocket.sendUrgentData (0xFF); System.out.println ("Socket still connected"); Thread Sleep (5 * 1000); } Hold (IOException e) {System.out.println ("Socket Disconnect"); SocketConnect = false; break; } Grip (Interrupted e) e.printStackTrace (); Logkat socket will still be connected
every 5 s
when I star on the activity and client activity
But when I come down from the server, it still will not show socket still connected
every 5 s
will not show socket disconnect
, my What's wrong with the code?
Comments
Post a Comment