win32 compatibility

do not use MSG_DONTWAIT on platforms that do not support it
bugfix: error

reverted buggy code