refactor set socket options