[rabbitmq-discuss] Library rabbitmq_c and TCP_NODELAY

Haster haster2004 at yandex.ru
Thu May 22 07:17:04 BST 2014


Hi Alan,

In my program I use TCP_NODELAY option of socket.
And now my code look like:

      connection = amqp_new_connection();
      if (!connection) {
        throw RabbitMQException(-1, "Create connection error");
      }
      int sockfd = amqp_open_socket(hostName.c_str(), portNumber);  //5672
      if (sockfd < 0) {
        std::string err_msg = "Opening socket: ";
        err_msg += amqp_error_string2(sockfd);
        throw RabbitMQException(-sockfd, err_msg.c_str());
      }
      int nodelay = 1;
      setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&nodelay,
sizeof(nodelay));
      amqp_set_sockfd(connection, sockfd);

But amqp_set_sockfd function is deprecated now and I'm afraid that it can be
dropped in future versions.
So can you add supporting TCP_NODELAY option in your future version of
rabbitmq_c?



--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/Library-rabbitmq-c-and-TCP-NODELAY-tp35761.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


More information about the rabbitmq-discuss mailing list