From 6ea6e5d802fda36843f05577ff6c321b5807d789 Mon Sep 17 00:00:00 2001 From: Damien O'Reilly Date: Sun, 11 Jun 2017 17:58:53 -0400 Subject: [PATCH] dgram: support for setting socket buffer size * setRecvBufferSize(int) and setSendBufferSize(int) * added docs for send/receive buffer sizes * Added options support to set buffer sizes in dgram.createSocket(). PR-URL: https://github.com/nodejs/node/pull/13623 Reviewed-By: Refael Ackermann Reviewed-By: Anna Henningsen --- lib/internal/errors.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 7f72e7a0e5..44a6b6b9bd 100755 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -261,6 +261,7 @@ E('ERR_SERVER_ALREADY_LISTEN', E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound'); E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer'); E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536'); +E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer'); E('ERR_SOCKET_BAD_TYPE', 'Bad socket type specified. Valid types are: udp4, udp6'); E('ERR_SOCKET_BUFFER_SIZE', @@ -268,6 +269,8 @@ E('ERR_SOCKET_BUFFER_SIZE', E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data'); E('ERR_SOCKET_CLOSED', 'Socket is closed'); E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running'); +E('ERR_SOCKET_BUFFER_SIZE', + (reason) => `Could not get or set buffer size: ${reason}`); E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed'); E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed'); E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode');