在Android手机和蓝牙模块连接好之后,先用蓝牙模块向手机发消息(int值),然后再用手机向蓝牙模块发消息,这时候有个警告:
07-17 17:08:07.544: W/System.err(11671): java.io.IOException: read failed, socket might closed or timeout, read ret: -1
07-17 17:08:07.544: W/System.err(11671): at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:523)
07-17 17:08:07.544: W/System.err(11671): at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:534)
07-17 17:08:07.544: W/System.err(11671): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:323)
然后在socket.connect中抛出异常:
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
然后在ouputstream.write()中抛出异常:
java.io.IOException: socket closed
请教一下,这个应该真么解决?在网上找了好久,但是都没有什么合适的办法。