Last active
August 29, 2015 14:19
-
-
Save rhencke/f14d4da5130124ef611a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // maybe session.local, or maybe session.option.local. Not sure. | |
| var binaryLocal = session.local.binary(function(value) { | |
| // value is the newly requested value for this. | |
| // Barring an error thrown, binaryLocal.value will equal value after the function call ends. | |
| // Do anything needed here, like proceed if client declined, or whatever. | |
| // can throw to decline support (forces false) | |
| // Forces IAC WONT, regardless of if this is a request or response. | |
| // (but tracks which it is internally.) | |
| if (value) { | |
| throw new Error("I can't do that, dave."); | |
| } | |
| })); | |
| // Request a new value for the setting. | |
| // Wanted to separate this from setting value below, to | |
| // emphasize this is not a guarantee of support. | |
| binarySrv.requestValue(true); | |
| // currently negotiated value. Read-only. | |
| // Can't access this unless a callback is registered. | |
| binarySrv.value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment