Modify the TCP\_NODELAY (‘de-Nagle’) flag for socket objects

Description

Modify the TCP\_NODELAY (‘de-Nagele’) flag for socket objects

Usage

1
setTCPNoDelay(socket, value=TRUE)

Arguments

socket

A socket connection object

value

Logical indicating whether to set (TRUE) or unset (FALSE) the flag

Details

By default, TCP connections wait a small fixed interval before actually sending data, in order to permit small packets to be combined. This algorithm is named after its inventor, John Nagle, and is often referred to as 'Nagling'.

While this reduces network resource utilization in these situations, it imposes a delay on all outgoing message data, which can cause problems in client/server situations.

This function allows this feature to be disabled (de-Nagling, value=TRUE) or enabled (Nagling, value=FALSE) for the specified socket.

Value

The character string "SUCCESS" will be returned invisible if the operation was succesful. On failure, an error will be generated.

Author(s)

Gregory R. Warnes greg@warnes.net

References

"Nagle's algorithm" at WhatIS.com http://searchnetworking.techtarget.com/sDefinition/0,,sid7_gci754347,00.html

Nagle, John. "Congestion Control in IP/TCP Internetworks", IETF Request for Comments 896, January 1984. http://www.ietf.org/rfc/rfc0896.txt?number=896

See Also

make.socket, socketConnection

Examples

1
2
3
4
5
## Not run: 
   s <- make.socket(host='www.r-project.org', port=80)
   setTCPNoDelay(s, value=TRUE)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.