+ /* create connection - pass options (they are the same for all) */
+ z[i] = ZOOM_connection_create(o);
+
+ /* connect and init */
+ ZOOM_connection_connect(z[i], parameters.host, 0);
+ }
+ /* search all */
+ for (i = 0; i < parameters.concurrent; i++)
+ r[i] = ZOOM_connection_search_pqf (z[i], parameters.query);
+
+ /* network I/O. pass number of connections and array of connections */
+ while ((i = ZOOM_event (parameters.concurrent, z))){
+ int event = ZOOM_connection_last_event(z[i-1]);
+ const char *errmsg;
+ const char *addinfo;
+ int error = 0;
+ //int progress = zoom_progress[event];
+
+ if (event == ZOOM_EVENT_SEND_DATA || event == ZOOM_EVENT_RECV_DATA)
+ continue;
+
+ time_stamp(&time);
+
+ /* updating events and event list */
+ error = ZOOM_connection_error(z[i-1] , &errmsg, &addinfo);
+ if (error)
+ parameters.progress[i] = zoom_progress[ZOOM_EVENT_UNKNOWN];
+ //parameters.progress[i] = zoom_progress[ZOOM_EVENT_NONE];
+ else if (event == ZOOM_EVENT_CONNECT)
+ parameters.progress[i] = zoom_progress[event];
+ else
+ //parameters.progress[i] = zoom_progress[event];
+ parameters.progress[i] += 1;
+
+ update_events(elc, els,
+ k, i-1,
+ time_sec(&time), time_usec(&time),
+ parameters.progress[i],
+ event, zoom_events[event],
+ error, errmsg);
+ }
+
+ /* destroy connections */
+ for (i = 0; i<parameters.concurrent; i++)
+ {
+ ZOOM_resultset_destroy (r[i]);
+ ZOOM_connection_destroy (z[i]);
+ }
+
+
+
+ } /* for (k = 0; k < parameters.repeat; k++) repeat loop */
+
+ /* output */
+
+ if (parameters.gnuplot){
+ printf("# gnuplot data and instruction file \n");
+ printf("# gnuplot thisfile \n");
+ printf("\n");
+ printf("set title \"Z39.50 connection plot\"\n");
+ printf("set xlabel \"Connection\"\n");
+ printf("set ylabel \"Time Seconds\"\n");
+ printf("set zlabel \"Progress\"\n");
+ printf("set ticslevel 0\n");
+ printf("set grid\n");
+ printf("set pm3d\n");
+ printf("splot '-' using ($1):($2):($3) t '' with points\n");
+ printf("\n");
+ printf("\n");