add sockopt handlers, compiles on Mac OS X