something's wrong in port_open command which is in C?where? probably a flush issue
I'm guessing someone forgets to flush before close or something