don't respond if the socket is already closed

i didn't add any tests yet - not sure how to test it yet.