2个参考:
http://www.blogjava.net/amplifier/archive/2007/04/12/110131.html
http://cuisuqiang.iteye.com/blog/1453632
大致方法是使用socket.sendUrgentData(0xFF); // 发送心跳包
try{
socket.sendUrgentData(0xFF);
}catch(Exception ex){
reconnect();
}
2个参考:
http://www.blogjava.net/amplifier/archive/2007/04/12/110131.html
http://cuisuqiang.iteye.com/blog/1453632
大致方法是使用socket.sendUrgentData(0xFF); // 发送心跳包
try{
socket.sendUrgentData(0xFF);
}catch(Exception ex){
reconnect();
}