Java AcceptOnDopen()方法错误
我正在制作一个与蓝牙相关的应用程序来浏览互联网。。服务器作为笔记本电脑/台式机,客户端作为移动电话。。我需要在客户端和服务器之间建立连接。。但是服务器的执行突然在方法acceptAndOpen处停止。。请帮忙解决这个问题。。这是它在服务器端停止的代码:Java AcceptOnDopen()方法错误,java,bluetooth,service-discovery,Java,Bluetooth,Service Discovery,我正在制作一个与蓝牙相关的应用程序来浏览互联网。。服务器作为笔记本电脑/台式机,客户端作为移动电话。。我需要在客户端和服务器之间建立连接。。但是服务器的执行突然在方法acceptAndOpen处停止。。请帮忙解决这个问题。。这是它在服务器端停止的代码: while (mServerState) { StreamConnection btConn = null; try { updateStatus("[server:] Now waiting for a clie
while (mServerState) {
StreamConnection btConn = null;
try {
updateStatus("[server:] Now waiting for a client to connect");
//here is the error
btConn = (StreamConnection) btServerNotifier.acceptAndOpen();
RemoteDevice dev = RemoteDevice.getRemoteDevice(btConn);
System.out.println("Remote device address: " + dev.getBluetoothAddress());
updateStatus("Remote device " + dev.getFriendlyName(true) + "connected");
} catch (IOException ioe) {
}
if (btConn != null) {
processConnection(btConn);
}
}
-你使用蓝湾图书馆吗?它看起来像-updateStatus函数做什么?仅打印输出?-我认为你应该更新你的问题,让它变得更好: