Java – MIDP application, blocked by Connector.Open(..)


I've been having the worst time of my life trying to understand why this is happening, any input would be greatly appreciated.

The code in question runs in a diffrent thread then the midlet, although the thread starts after the connection is made, I've tried the other way around and I end up at the same spot.

When executing this line (with a proven and working server address of course):

this.socket = (SocketConnection);

nothing happens and when I hit pause in debug it takes me to this msg:

@exception IllegalMonitorStateException if the current thread is not
the owner of the object's monitor.

Best Solution

I think you should implement your socket and network code/modules in a seperate thread.