Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket option: wsopt(type) configures ws frame format #148

Merged
merged 1 commit into from
Feb 8, 2016
Merged

Conversation

reqshark
Copy link
Collaborator

@reqshark reqshark commented Feb 1, 2016

fixing #139, socket.wsopt(type) exposes two useful options for setting/getting on WS sockets.

Two frame formats are supported: 'binary' and 'text'.

var pub = require('nanomsg').socket('pub')
console.log(pub.wsopt())  // 'binary'

pub.wsopt('text')
console.log(pub.wsopt()) // 'text'

// ... btw, probably best to do bind/connect stuff after setting msg type

@reqshark reqshark changed the title socket option: wsmsgtype() configures ws frame format socket option: wsopt(type) configures ws frame format Feb 1, 2016
@reqshark
Copy link
Collaborator Author

reqshark commented Feb 1, 2016

renaming that option from socket.wsmsgtype() to socket.wsopt()

Nan::Set(target,
Nan::New("NN_WS_MSG_TYPE_TEXT").ToLocalChecked(),Nan::New<Number>(0x01));
Nan::Set(target,
Nan::New("NN_WS_MSG_TYPE_BINARY").ToLocalChecked(),Nan::New<Number>(0x02));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm going to remove these lines

@reqshark
Copy link
Collaborator Author

reqshark commented Feb 6, 2016

@nickdesaulniers, I'm planning to remove those ws specific export lines in the binding and just update libnanomsg in this PR in light of nanomsg/nanomsg#600

• fixes #139
• update libnanomsg
• add new symbols to test and remove extra line breaks

PR: #148

Signed-off-by: Bent Cardan <bent@nothingsatisfies.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant