no reason to terminate connection before upgrade request

I used your code to get familiar with sockets (thanks!) and realized one thing while working with it and wanted to give it back. Your disconnect and reconnect is superfluous. Try it on your setup.