factory impl for tcp/udp/ssl