struct pollfd pfd;
struct libwebsocket *wsi;
int n;
+ int opt = 1;
int plen = 0;
#ifndef LWS_OPENSSL_SUPPORT
if (ssl_connection) {
server_addr.sin_addr = *((struct in_addr *)server_hostent->h_addr);
bzero(&server_addr.sin_zero, 8);
+ /* Disable Nagle */
+ setsockopt(wsi->sock, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt));
+
if (connect(wsi->sock, (struct sockaddr *)&server_addr,
sizeof(struct sockaddr)) == -1) {
fprintf(stderr, "Connect failed\n");
struct lws_tokens eff_buf;
int ext_count = 0;
struct libwebsocket_extension *ext;
+ int opt = 1;
#ifdef LWS_OPENSSL_SUPPORT
char ssl_err_buf[512];
break;
}
+ /* Disable Nagle */
+ opt = 1;
+ setsockopt(accept_fd, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt));
+
if (context->fds_count >= MAX_CLIENTS) {
fprintf(stderr, "too busy to accept new client\n");
#ifdef WIN32
/* allow us to restart even if old sockets in TIME_WAIT */
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+
+ /* Disable Nagle */
+ opt = 1;
+ setsockopt(sockfd, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt));
+
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
if (interf == NULL)