4 int main(int argc, char **argv) {
5 if (argc != 4) xperror("invocation: <host> <port> <spamstr>", 0);
6 int s = netopen(argv[1], argv[2], JH_TCP_HINTS);
8 fprintf(stderr, "unable to connect: %s\n", gai_strerror(s));
12 ssize_t len = strlen(buf);
15 ssize_t wcount = fail_on_neg(write(s, buf, len), "write failed", 1);
17 fprintf(stderr, "zero write! ending.\n");
21 fprintf(stderr, "wrong write size! ending.\n");
25 fprintf(stderr, "%zd\n", total);