Check whether socket is still open

What were you hitting that made you want this?