nickdesaulniers / node-nanomsg

Node.js binding for nanomsg
MIT License
402 stars 70 forks source link

add NN_MAXTTL option to sockopt api #190

Closed reqshark closed 6 years ago

reqshark commented 7 years ago

fixes #180 making the option available from the sockopt api:

socket.maxttl(hops)

(Function, param: Number, default: 8): Sets the maximum number of "hops" a message can go through before it is dropped. Each time the message is received (for example via the nn_device(3) function) counts as a single hop. This provides a form of protection against inadvertent loops.

Pass no parameter for the socket's maxttl hop count.

socket.maxttl(4);
console.log(socket.maxttl()); // 4

@nickdesaulniers, review?

reqshark commented 7 years ago

also we might want to get #188 in first so we can see tests are passing for this new option

nickdesaulniers commented 6 years ago

do we want to rekick the tests?

reqshark commented 6 years ago

yessir let me just rebase off master, just a sec

reqshark commented 6 years ago

k that should get us back to green on travis :)