Allow to exchange binary event through socket #53

flowersinthesand opened this Issue Jan 22, 2015 · 1 comment


None yet

1 participant


Thanks to #52, #54 and #56, socket can exchange event made of binary on top of transport. Because event is object, event format for binary event is required like JSON for text event, which is used to serialize binary event to binary message and deserialize binary message to binary event.

For example, the following formats support binary-based data:

The event format should be available on as many platform as possible and have high performance. Also, it must be available on browser, Node and Java. However note that these event format will be able to be replaced with user-defined one. #27

For this feature, new API to send binary event is needed. The current signature of socket.send method is socket.send(event: string, data: any). In this method, an event object is made of event, data, and so on and serialized into text message by JSON, event format for text event, and is passed to transport.send(message: string).

Because of data: any, the current signature can't (or not easy to) determine whether to send it as text or binary. Interestingly, some candidate formats insist that they are faster and more efficient than JSON so that user might want to use binary event only.


As pointed out in #27 (comment), the necessity of the event format should be reviewed first before working on this. The goal of this feature is to exchange binary data without binary-to-text conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment