BlazorSignalR icon indicating copy to clipboard operation
BlazorSignalR copied to clipboard

MessagePack Protocol with WebSockets

Open netclectic opened this issue 5 years ago • 5 comments

Is there a known issue using the MessagePack Protocol over WebSockets?

It seems to work ok when explicitly set to use the LongPolling transport and using the Json protocol with WebSockets also works ok.

However, when I switch to MessagePack it seems to complete the negotiation ok and I see a few 'Binary Message (Opcode 2)' messages but the request never completes and eventually the server side closes the connection.

I have an existing WinForms app which works fine connecting to the same hub but I am also struggling to get it to work the sample apps included in this repo.

Is this a known problem, or do you know of any workaround or fix?

netclectic avatar Mar 25 '19 14:03 netclectic

Which version of BlazorSignalR are you using?

MessagePack support has never been explicitly tested, however JSON and MessagePack use the same marshalling code.

If you could provide a minimal reproduction test case (such as editing the test project to use MessagePack) would be helpful.

csnewman avatar Mar 25 '19 14:03 csnewman

I'm using the latest bits with: '0.5.0-blazor-0.9.0-preview3-19154-02'

I added a messagepack branch to a fork of the repo here: https://github.com/netclectic/BlazorSignalR/tree/messagepack

netclectic avatar Mar 25 '19 14:03 netclectic

Thanks for that.

I think I have an idea of what's happening, but I won't get a chance to take a look until later. My assumption is that when the websocket is in binary mode, the marshaling isn't handling the object conversation correctly.

csnewman avatar Mar 25 '19 14:03 csnewman

Cool, no rush here. I can continue to use LongPolling or Json for the time being.

netclectic avatar Mar 25 '19 14:03 netclectic

#24 Tracks supporting binary protocols.

Once that has been fixed, then we can look into this issue.

csnewman avatar May 12 '19 14:05 csnewman