Skip to content

Client Connected and Disconnected events

Ali Yousefi edited this page Feb 12, 2019 · 3 revisions
                //one client connected
                server.OnClientConnectedAction = (client) =>
                {
                    client.OnDisconnected = () =>
                    {
                        //client disconnected
                    };
                };

                //or another way to detect client disconneced:
                server.OnClientDisconnectedAction = (client) =>
                {

                };
                //force disconnect client
                server.CloseClient(clientInfo);

                //server disconnected
                server.DisconnectedAction = () =>
                {

                };