mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 10:31:37 -08:00
Add support for TCP_NODELAY on network streams
* src/process.c (socket_options): add entry for TCP_NODELAY. * lisp/emacs-lisp/bytecomp.el: add :nodelay to valid keywords for make-network-process compiler-macro. * doc/lispref/processes.texi: document :nodelay keyword argument to set-network-process-option and make-network-process. (Bug#74793)
This commit is contained in:
parent
989cdb2c35
commit
c265febd97
3 changed files with 14 additions and 2 deletions
|
|
@ -3090,6 +3090,13 @@ listening on that port. If @var{reuseaddr-flag} is @code{nil}, there
|
||||||
may be a period of time after the last use of that port (by any
|
may be a period of time after the last use of that port (by any
|
||||||
process on the host) where it is not possible to make a new server on
|
process on the host) where it is not possible to make a new server on
|
||||||
that port.
|
that port.
|
||||||
|
|
||||||
|
@item :nodelay @var{nodelay-flag}
|
||||||
|
If @var{nodelay-flag} is non-@code{nil}, the @code{TCP_NODELAY} option
|
||||||
|
is enabled on the socket. This disables the Nagle algorithm, meaning
|
||||||
|
that network segments are sent as soon as possible, even when they
|
||||||
|
contain little data. This reduces network latency on the network
|
||||||
|
connection, but can lead to many small packets being sent.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@defun set-network-process-option process option value &optional no-error
|
@defun set-network-process-option process option value &optional no-error
|
||||||
|
|
|
||||||
|
|
@ -6049,8 +6049,8 @@ and corresponding effects."
|
||||||
:buffer :host :service :type :family :local :remote :coding
|
:buffer :host :service :type :family :local :remote :coding
|
||||||
:nowait :noquery :stop :filter :filter-multibyte :sentinel
|
:nowait :noquery :stop :filter :filter-multibyte :sentinel
|
||||||
:log :plist :tls-parameters :server :broadcast :dontroute
|
:log :plist :tls-parameters :server :broadcast :dontroute
|
||||||
:keepalive :linger :oobinline :priority :reuseaddr :bindtodevice
|
:keepalive :linger :oobinline :priority :reuseaddr :nodelay
|
||||||
:use-external-socket)
|
:bindtodevice :use-external-socket)
|
||||||
'(:name :service))))
|
'(:name :service))))
|
||||||
|
|
||||||
(provide 'byte-compile)
|
(provide 'byte-compile)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#include <netinet/tcp.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
@ -2860,6 +2861,9 @@ static const struct socket_options {
|
||||||
#endif
|
#endif
|
||||||
#ifdef SO_REUSEADDR
|
#ifdef SO_REUSEADDR
|
||||||
{ ":reuseaddr", SOL_SOCKET, SO_REUSEADDR, SOPT_BOOL, OPIX_REUSEADDR },
|
{ ":reuseaddr", SOL_SOCKET, SO_REUSEADDR, SOPT_BOOL, OPIX_REUSEADDR },
|
||||||
|
#endif
|
||||||
|
#ifdef TCP_NODELAY
|
||||||
|
{ ":nodelay", IPPROTO_TCP, TCP_NODELAY, SOPT_BOOL, OPIX_MISC },
|
||||||
#endif
|
#endif
|
||||||
{ 0, 0, 0, SOPT_UNKNOWN, OPIX_NONE }
|
{ 0, 0, 0, SOPT_UNKNOWN, OPIX_NONE }
|
||||||
};
|
};
|
||||||
|
|
@ -3899,6 +3903,7 @@ The following network options can be specified for this connection:
|
||||||
:broadcast BOOL -- Allow send and receive of datagram broadcasts.
|
:broadcast BOOL -- Allow send and receive of datagram broadcasts.
|
||||||
:dontroute BOOL -- Only send to directly connected hosts.
|
:dontroute BOOL -- Only send to directly connected hosts.
|
||||||
:keepalive BOOL -- Send keep-alive messages on network stream.
|
:keepalive BOOL -- Send keep-alive messages on network stream.
|
||||||
|
:nodelay BOOL -- Set TCP_NODELAY on the network socket.
|
||||||
:linger BOOL or TIMEOUT -- Send queued messages before closing.
|
:linger BOOL or TIMEOUT -- Send queued messages before closing.
|
||||||
:oobinline BOOL -- Place out-of-band data in receive data stream.
|
:oobinline BOOL -- Place out-of-band data in receive data stream.
|
||||||
:priority INT -- Set protocol defined priority for sent packets.
|
:priority INT -- Set protocol defined priority for sent packets.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue