When using the OnOpen() delegate with a Websocket, the IWebsocketConnection passed by the framework indicates synchronous methods when they are actually not. The methods should be renamed to *Async and the delegate should return a ValueTask instead. We can add synchronous methods as well.
Example
Websocket.Create()
.OnOpen(async (c) => await c.SendAsync("42"));
Additional Information
- Either keep the changes non-breaking (e.g. with warnings) or postpone them to version 10 (and include them in a change log)
When using the
OnOpen()delegate with aWebsocket, theIWebsocketConnectionpassed by the framework indicates synchronous methods when they are actually not. The methods should be renamed to*Asyncand the delegate should return aValueTaskinstead. We can add synchronous methods as well.Example
Additional Information