6 Replies
What im trying to achieve with these functions is that when a connection receives an a
CreateRoomEvent
the scoped room in HandleUpgrade
should get set. But since ref params dont work with async code this currently doesnt work and the room in HandleUpgrade
stays null
Is there an elegant solution for this?I didn't read through all of the code, but usually a workaround which achieves a similar behaviour would be to introduce by-ref semantics by passing delegates with a setter, or you simply wrap room / client structure in a container you can then pass around and change the reference inside
I think in this case a dictionary based approach might work, passing a room and client map around?
you mean storing a dictionary with <Guid, Room> where i can get the room on every message?
Yeah, would that work for you?
If you can pass around a container for the room and client then you don't have the problem of requiring a ref
yeah that should work gonna experiment a lil bit on which solution fits here the best
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.