return 1;
}
- ev.events = EPOLLIN|EPOLLOUT;
+ ev.events = EPOLLIN;
+
+ // Let us know when the socket is ready for sending data
+ if (!conf->keepalive_only)
+ ev.events |= EPOLLOUT;
DEBUG(conf, "Opening %lu connections...\n", conf->parallel);
static struct option long_options[] = {
{"client", required_argument, 0, 'c'},
{"debug", no_argument, 0, 'd'},
+ {"keepalive", no_argument, 0, 'k'},
{"parallel", required_argument, 0, 'P'},
{"port", required_argument, 0, 'p'},
{"server", no_argument, 0, 's'},
int done = 0;
while (!done) {
- int c = getopt_long(argc, argv, "c:dp:st:zP:", long_options, &option_index);
+ int c = getopt_long(argc, argv, "c:dkp:st:zP:", long_options, &option_index);
// End
if (c == -1)
conf->loglevel = LOG_DEBUG;
break;
+ case 'k':
+ conf->keepalive_only = 1;
+ break;
+
case 'P':
conf->parallel = strtoul(optarg, NULL, 10);