csnewman / BlazorSignalR

SignalR Core C# client Blazor compatibility
MIT License
64 stars 21 forks source link

MessagePack Protocol with WebSockets #15

Open netclectic opened 5 years ago

netclectic commented 5 years ago

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?

csnewman commented 5 years ago

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.

netclectic commented 5 years ago

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

csnewman commented 5 years ago

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.

netclectic commented 5 years ago

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

csnewman commented 5 years ago

24 Tracks supporting binary protocols.

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