Add bool to determine if socket has been closed.