I have a midlet that is listening incoming bluetooth connections:

private StreamConnectionNotifier server = null;
private StreamConnection conn = null;

try {
System.err.println("Listening bluetooth..");
conn = server.acceptAndOpen();
System.err.println("Client connected!");

What is the proper way to close StreamConnectionNotifier ?

If I use server.close() then I get an application error in Nokia 6600 and on Nokia Series 60 0_3_1 emulator the whole emulator freezes.