fixed setsockopt bugs