-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Add the hasBinary flag #2838
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
Closed
Closed
Add the hasBinary flag #2838
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7eccc4d
Add the hasBinary flag
Andrews54757 ae0b325
Dont need this anymore
Andrews54757 b0acd59
Cleanup
Andrews54757 24e1316
Add to namespace
Andrews54757 fb702bb
Update documentation
Andrews54757 c84cc09
Documentation
Andrews54757 d27ab74
Link fixes
Andrews54757 e99224b
Spelling
Andrews54757 dfcee4c
Spelling
Andrews54757 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ | |
| - [Event: 'connection'](#event-connect) | ||
| - [Flag: 'volatile'](#flag-volatile) | ||
| - [Flag: 'local'](#flag-local) | ||
| - [Flag: 'hasBinary'](#flag-hasbinary) | ||
| - [Class: Socket](#socket) | ||
| - [socket.id](#socketid) | ||
| - [socket.rooms](#socketrooms) | ||
|
|
@@ -47,6 +48,7 @@ | |
| - [socket.disconnect(close)](#socketdisconnectclose) | ||
| - [Flag: 'broadcast'](#flag-broadcast) | ||
| - [Flag: 'volatile'](#flag-volatile-1) | ||
| - [Flag: 'hasBinary'](#flag-hasbinary-1) | ||
| - [Event: 'disconnect'](#event-disconnect) | ||
| - [Event: 'error'](#event-error) | ||
| - [Event: 'disconnecting'](#event-disconnecting) | ||
|
|
@@ -327,6 +329,14 @@ Sets a modifier for a subsequent event emission that the event data may be lost | |
| io.volatile.emit('an event', { some: 'data' }); // the clients may or may not receive it | ||
| ``` | ||
|
|
||
| #### Flag: 'hasBinary' | ||
|
|
||
| Specifies whether there is binary data in the data to send. Increases preformance when specified. Can be `true` or `false`. | ||
|
|
||
| ```js | ||
| io.hasBinary(false).emit('an event', { some: 'data' }); | ||
| ``` | ||
|
|
||
| #### Flag: 'local' | ||
|
|
||
| Sets a modifier for a subsequent event emission that the event data will only be _broadcast_ to the current node (when the [Redis adapter](https://github.com/socketio/socket.io-redis) is used). | ||
|
|
@@ -545,6 +555,17 @@ io.on('connection', function(socket){ | |
| }); | ||
| ``` | ||
|
|
||
| #### Flag: 'hasBinary' | ||
|
|
||
| Specifies whether there is binary data in the data to send. Increases preformance when specified. Can be `true` or `false`. | ||
|
||
|
|
||
| ```js | ||
| var io = require('socket.io')(); | ||
| io.on('connection', function(socket){ | ||
| socket.hasBinary(false).emit('an event', { some: 'data' }); // The data to send has no binary data | ||
| }); | ||
| ``` | ||
|
|
||
| #### Event: 'disconnect' | ||
|
|
||
| - `reason` _(String)_ the reason of the disconnection (either client or server-side) | ||
|
|
||
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preformance -> performance
data to send -> emited data ?