Socket stack: functorize over IPV4/IPV6