/// <summary> /// connect not timer. /// </summary> public void InitConnect() { if (_netProxy == null) { _netProxy = NetProxy.Create(Setting.Url); } _netProxy.CheckConnect(); }
public static NetProxy Create(string remoteAddress) { NetProxy session = null; var address = (remoteAddress ?? "").Split(':'); if (address.Length > 1 && !address[0].StartsWith("http", StringComparison.CurrentCultureIgnoreCase)) { session = new SocketNetProxy(address[0], Convert.ToInt32(address[1])); } else { session = new HttpNetProxy(remoteAddress); } return(session); }