change Connection.setsockopt to Connection._setsockopt
just send EOF if client side connection closed normally