You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HCGetWebSocketConnectResult seems to populate result with a different websocket handle than one used to call HCWebSocketConnectAsync. When multiple simultaneous connections are used I wanted to use WebSocketCompletionResult::websocket to disambiguate between them, but it seems not possible.
You are correct, this was somewhat intentional. After calling HCWebSocketConnectAsync, the internal WebSocket object will be kept alive by libHttpClient until it is disconnected - even if the client closes their handle. The handle populated in the result is guaranteed to be a valid handle to the WebSocket, while the client's handle isn't.
In theory, you should be able to disambiguate between which WebSocket is connection is completing based on the XAsync context, but I also recognize that using the returned handle would be easier/more intuitive. I will change this to pass back the client's handle as part of the connect result, but the library still makes no guarantees that the handle is valid as it's still owned by the client.
In actual app context is already taken by this :) Your plan to pass handle used in connect call is very welcome. It will also make on connect callback more alike rest of callbacks on the websocket.
HCGetWebSocketConnectResult
seems to populate result with a different websocket handle than one used to call HCWebSocketConnectAsync. When multiple simultaneous connections are used I wanted to useWebSocketCompletionResult::websocket
to disambiguate between them, but it seems not possible.The text was updated successfully, but these errors were encountered: