我一直在努力理解为什么会发生这种情况,这是我一生中最糟糕的时光,我们将不胜感激。
有问题的代码在不同的线程中运行,然后在 midlet 中运行,尽管线程在建立连接后启动,但我已经尝试了相反的方法,但我最终还是在同一个位置。
执行此行时(当然要使用经过验证且有效的服务器地址):
this.socket = (SocketConnection) Connector.open(url);
没有任何反应,当我在调试中按下暂停键时,它会将我带到这条消息:
@exception IllegalMonitorStateException if the current thread is not
the owner of the object's monitor.
最佳答案
我认为您应该在单独的线程中实现您的套接字和网络代码/模块。
关于java - MIDP 应用程序,被 Connector.Open(..) 阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1626720/