calling disconnect on, shutdown so that thread stops before socket timeout