serial.close() freeze

Hi;

When closing the serial port on OSX, the desktop freezes momentarily, this does not happen under windows.

How can I prevent this as the serial port is being opened and closed once a minute to read / write data and this is presently a show-stopper for the whole project !

Thanks

Pete

Why do you need to close it?

Hello Tim;

These are Bluetooth serial ports.

The bluetooth devices often disconnect and / or go out of range, the only way to re-establish connection is to close the port and re-open it again.

I suspect that this is a bug with the mac implementation of serial.close() as it does not happen on windowz.

[quote=15736:@Peter Cruickshank]Hello Tim;

These are Bluetooth serial ports.

The bluetooth devices often disconnect and / or go out of range, the only way to re-establish connection is to close the port and re-open it again.

I suspect that this is a bug with the mac implementation of serial.close() as it does not happen on windowz.[/quote]
Just curious do you know how to obtain the serial port name? I currently have a usb to serial adapter connect to Mac. the name of it is /dev/tty.usbserial-XXXXXXXX. I know I can use

Serial1.SerialPort = System.SerialPort("/dev/tty.usbserial-XXXXXXXX"

to open it directly. But I need a little flexibility, for example, the program can list out all the port name and let the user to choose one from a dropdown list.