From 350b7fe82c54117f423fc1bc174f6f65ba855fc4 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期五, 16 十月 2020 09:56:53 +0800
Subject: [PATCH] update

---
 src/socket/net_mod_socket.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/socket/net_mod_socket.c b/src/socket/net_mod_socket.c
index 2edd834..aebd15b 100644
--- a/src/socket/net_mod_socket.c
+++ b/src/socket/net_mod_socket.c
@@ -1,6 +1,8 @@
 #include "net_mod_socket.h"
 #include "socket_io.h"
 #include "net_mod_socket_io.h"
+#include <sys/types.h>          /* See NOTES */
+#include <sys/socket.h>
 
 
 std::map<std::string, int> NetModSocket::connectionMap;
@@ -57,7 +59,7 @@
   char response_head_bs[NET_MODE_RESPONSE_HEAD_LENGTH];
   net_mod_request_head_t request_head = {};
   net_mod_response_head_t response_head;
- 
+  int optval;
    
   int nsuc = 0;
   net_mod_recv_msg_t *ret_arr = (net_mod_recv_msg_t *)calloc(arrlen, sizeof(net_mod_recv_msg_t));
@@ -79,6 +81,8 @@
     request_head.key = node->key;
     request_head.content_length = send_size;
     request_head.topic_length = 0;
+    // optval = 1;
+    // setsockopt(clientfd, IPPROTO_TCP, TCP_CORK, &optval, sizeof(optval));
     if(rio_writen(clientfd, NetModSocket::encode_request_head(request_head), NET_MODE_REQUEST_HEAD_LENGTH) != NET_MODE_REQUEST_HEAD_LENGTH) {
       LoggerFactory::getLogger()->error(errno, "NetModSocket::send head rio_writen");
       remove_connect(node->host, node->port);
@@ -93,7 +97,8 @@
       close(clientfd);
       continue;
     }
-
+    // optval = 0;
+    // setsockopt(clientfd, IPPROTO_TCP, TCP_CORK, &optval, sizeof(optval));
 
     if ( rio_readn(clientfd, response_head_bs, NET_MODE_RESPONSE_HEAD_LENGTH) !=  NET_MODE_RESPONSE_HEAD_LENGTH) {
       LoggerFactory::getLogger()->error(errno, "NetModSocket::send  rio_readnb");

--
Gitblit v1.8.0