JBTM-1684 update to check socket is close