derhuerst/node-sockopt

handle non-integer flags

Open

#1 opened on Feb 25, 2020

View on GitHub
 (1 comment) (1 reaction) (0 assignees)JavaScript (3 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (9 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

From https://github.com/derhuerst/node-sockopt/blob/19410b3a048efa3bbb3f955e677e438bbdc6104d/index.js#L21-L25:

Currently _setsockopt (& _getsockopt) only handles integers. todo: fails with e.g. SO_RCVTIMEO/SO_SNDTIMEO

if (!Number.isInteger(flagValue)) {
	throw new Error('flagValue must be an integer')
}

The native code would have to be adapted to create the appropriate structs for selected flags.

Contributor guide