set socket settings before actually binding socket