
const int val = 1;
int ret = setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
if (ret < 0) {
  perror("setsockopt(TCP_NODELAY)");
  exit(1);
}

