Rename PostMessage to SendMessage. They have different parameter values so it's okay
Close the socket when attempting a new connection so that it no longer sometimes displays it can't connect to a server it can actually connect to