当我将请求发送到设备(硬件)但在收听tcp数据时没有得到响应时,我得到了响应
final Runnable r1 = new Runnable() {
Socket listener;
public void run() {
try{
System.out.print("######## Thread Started######");
serverSocket = new ServerSocket(5555);
String message = null;
while(true){
listener = serverSocket.accept();
BufferedReader inFromServer = new BufferedReader(new InputStreamReader(listener.getInputStream()));
message = inFromServer.readLine();
System.out.println("*** Received message inside connection Thread"+message);
}
}catch(Throwable e){
e.printStackTrace();
}
handler.postDelayed(this, 1000);
}
};
handler.postDelayed(r1, 1000);