tcp: (Mac OS X) added setsockopt(SOL_SOCKET, SO_NOSIGPIPE) to prevent the application crashing on a broken socket.