Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
MainActivity.this.in = MainActivity.this.uart.getInputStream(); int re = in.read();
以上都是我的部分代码。我想从外围设备中读取一个数字。如果等待时间超过 3 秒。停止!然后出现警告信息!但我不知道如何中断等待。
Socket.setSoTimeout(3000L)尝试在调用之前将 so_timeout 设置为相应的套接字in.read();
Socket.setSoTimeout(3000L)
in.read();