net/ConnectSocket: move code to function with "type" parameter
net/ConnectSocket: move code to function with "type" parameter

CM4all/beng-proxy,CM4all/beng-proxy,CM4all/beng-proxy,CM4all/beng-proxy,CM4all/beng-proxy,CM4all/beng-proxy