substream icon indicating copy to clipboard operation
substream copied to clipboard

separate en/de-coder for substreams

Open siddo420 opened this issue 10 years ago • 4 comments

can I use different parsers for separate substeams (and main stream)? If yes, how do I do that?

I have Parser object instantiated on the server side with default JSON parser.

Can I simply use a new substream for binary data?

siddo420 avatar Nov 03 '15 12:11 siddo420

AFAIK right now it isn't possible. Every substream uses the same parser (the one used by the underlying stream).

lpinca avatar Nov 05 '15 10:11 lpinca

Hows hard would it be to implement this feature? Any tips/tricks/workarounds you could think of?

siddo420 avatar Nov 06 '15 13:11 siddo420

I don't know, it's not easy and it will probably require structural changes in Primus.

lpinca avatar Nov 06 '15 14:11 lpinca

I guess, I have to use multiple primus instances on server side and client side if I need to use primus for both binary and JSON data transfer. Or, intercept messages?

Can you think of a module that allows binary file transfer using primus? I only found some links for socket.io through Google.

siddo420 avatar Nov 06 '15 15:11 siddo420