ValveSockets-CSharp icon indicating copy to clipboard operation
ValveSockets-CSharp copied to clipboard

Non-global connection callbacks

Open joshua-light opened this issue 3 years ago • 1 comments

Hi!

Is there a way to set a connection status handler callback for a specific NetworkingSockets instance?

Currently, it's recommended to use NetworkingUtils.SetStatusCallback. However, as far as I see, this sets a global per application callback, which doesn't allow to create both client and server in a single app.

Thanks!

joshua-light avatar Aug 24 '22 20:08 joshua-light

Years late, but if you are still interested, you can take a look at https://github.com/copyrat90/ValveSockets-CSharp/commit/f7f4e12ab2199ad4294a77007462b6bc9cab3e92

Although, I won't directly send a PR here, because I've added #23 and made some changes on the API. (I've changed the API because there's more status callbacks other than connection status changed)

copyrat90 avatar Feb 13 '25 10:02 copyrat90