This function sets a callback that is invoked after the socket is created, but before the connection is established. This is an ideal time to customize various socket options.