added ability to determine if socket is available