pull out 'low-level socket methods' into socket hook.