[rabbitmq-discuss] Library rabbitmq_c and TCP_NODELAY

Alan Antonuk alan.antonuk at gmail.com
Thu May 22 21:23:04 BST 2014


By default rabbitmq-c sets TCP_NODELAY on:

https://github.com/alanxz/rabbitmq-c/blob/master/librabbitmq/amqp_socket.c#L328

There should be no reason for you to be changing this socket parameter.

-Alan

On Wed May 21 2014 at 11:17:40 PM, Haster <haster2004 at yandex.ru> wrote:

> 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.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140522/d56501c0/attachment.html>


More information about the rabbitmq-discuss mailing list