private void session() {
DataInputStream dis = null;
DataOutputStream dos = null;
try {
dis = new DataInputStream(mSocket.getInputStream());
dos = new DataOutputStream(mSocket.getOutputStream());
while (true) {
String data = “PC时间:” + System.currentTimeMillis();
dos.writeUTF(data);
dos.flush();
String s = dis.readUTF();
mLogger.info(“收到数据:” + s);
Thread.sleep(5000);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
mSocket.close();
} catch (Exception e) {
e.printStackTrace();
}
mSocket = null;
}
}
public SocketTest() {
mScheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
mRunnable = new Runnable() {
@Override