converted Win socket code to use debug messages to Debug/KNS_SOCKET