Use keyword arguments to avoid ordering problems
Add comment and fix usage of setsockopt