protected virtual TSI GetServerInfoQueryResult(string ip, ushort port) { if (port == 0) { throw new InvalidPortException(); } IQueryExecutor <TSI, TPI> queryExecutor = Activator.CreateInstance(typeof(TQE), ip, port) as IQueryExecutor <TSI, TPI>; if (queryExecutor != null) { try { return(queryExecutor.GetServerInfo()); } catch (FormatException) { throw new InvalidIpAddressException(); } } throw new QueryExecutorInitializationException(); }