f683064dc6a998206665b484790ef9d561e6c8a7
markd
  Sat Dec 5 22:42:53 2020 -0800
initial conversion to gfServer connection to object

diff --git src/gfClient/gfClient.c src/gfClient/gfClient.c
index 6cf683e..ef9a950 100644
--- src/gfClient/gfClient.c
+++ src/gfClient/gfClient.c
@@ -102,65 +102,65 @@
 static bioSeq seq;
 FILE *out = mustOpen(outName, "w");
 enum gfType qType = gfTypeFromName(qTypeName);
 enum gfType tType = gfTypeFromName(tTypeName);
 int dotMod = 0;
 char databaseName[256];
 struct hash *tFileCache = gfFileCacheNew();
 
 snprintf(databaseName, sizeof(databaseName), "%s:%s", hostName, portName);
 
 gvo = gfOutputAny(outputFormat,  round(minIdentity*10), qType == gftProt, tType == gftProt,
 	optionExists("nohead"), databaseName, 23, 3.0e9, minIdentity, out);
 gfOutputHead(gvo, out);
 while (faSomeSpeedReadNext(lf, &seq.dna, &seq.size, &seq.name, qType != gftProt))
     {
-    int conn = gfConnect(hostName, portName);
+    struct gfConnection *conn = gfConnect(hostName, portName);
     if (dots != 0)
         {
 	if (++dotMod >= dots)
 	    {
 	    dotMod = 0;
 	    fputc('.', stdout);
 	    fflush(stdout);
 	    }
 	}
     if (qType == gftProt && (tType == gftDnaX || tType == gftRnaX))
         {
 	gvo->reportTargetStrand = TRUE;
-	gfAlignTrans(&conn, tSeqDir, &seq, minScore, tFileCache, gvo, genome, genomeDataDir);
+	gfAlignTrans(conn, tSeqDir, &seq, minScore, tFileCache, gvo, genome, genomeDataDir);
 	}
     else if ((qType == gftRnaX || qType == gftDnaX) && (tType == gftDnaX || tType == gftRnaX))
         {
 	gvo->reportTargetStrand = TRUE;
-	gfAlignTransTrans(&conn, tSeqDir, &seq, FALSE, minScore, tFileCache, 
+	gfAlignTransTrans(conn, tSeqDir, &seq, FALSE, minScore, tFileCache, 
                           gvo, qType == gftRnaX, genome, genomeDataDir);
 	if (qType == gftDnaX)
 	    {
 	    reverseComplement(seq.dna, seq.size);
-	    close(conn);
+	    gfDisconnect(&conn);
 	    conn = gfConnect(hostName, portName);
-	    gfAlignTransTrans(&conn, tSeqDir, &seq, TRUE, minScore, tFileCache,
+	    gfAlignTransTrans(conn, tSeqDir, &seq, TRUE, minScore, tFileCache,
                               gvo, FALSE, genome, genomeDataDir);
 	    }
 	}
     else if ((tType == gftDna || tType == gftRna) && (qType == gftDna || qType == gftRna))
 	{
-	gfAlignStrand(&conn, tSeqDir, &seq, FALSE, minScore, tFileCache, gvo, genome, genomeDataDir);
+	gfAlignStrand(conn, tSeqDir, &seq, FALSE, minScore, tFileCache, gvo, genome, genomeDataDir);
 	conn = gfConnect(hostName, portName);
 	reverseComplement(seq.dna, seq.size);
-	gfAlignStrand(&conn, tSeqDir, &seq, TRUE,  minScore, tFileCache, gvo, genome, genomeDataDir);
+	gfAlignStrand(conn, tSeqDir, &seq, TRUE,  minScore, tFileCache, gvo, genome, genomeDataDir);
 	}
     else
         {
 	errAbort("Comparisons between %s queries and %s databases not yet supported",
 		qTypeName, tTypeName);
 	}
     gfOutputQuery(gvo, out);
     }
 if (out != stdout)
     printf("Output is in %s\n", outName);
 gfFileCacheFree(&tFileCache);
 }
 
 int main(int argc, char *argv[])
 /* Process command line. */