Trigger event after client connected on server side
Hello, i want call few function initialization after client success connected. Does server has onOpen method or something similar?
@Lukasz199312 yes, have you had time to read the docs?
@Lukasz199312 yes, have you had time to read the docs?
The WebSocketBehavior.OnOpen and WebSocketBehavior.OnClose event is fired only when the server's session is opened or closed, NOT when a new client has established a connection to the server or disconnected from the server.
There is no such thing as WebSocketBehavior.OnConnect or WebSocketBehavior.OnDisconnect event fired when the client connected or disconnected from the server, even though it does make sense to have it as an event already because otherwise you'd have to check the clients list by each "tick" or make a new interface for notifying connection (and not to mention that they both are technically bad practices). I wonder why.