Exemple #1
0
            void OnDestroy()
            {
                if (_cmdServer != null)
                {
                    _cmdServer.Close();
                    _cmdServer = null;
                }

                for (int i = 0; i < _socketConnections.Count; i++)
                {
                    if (_socketConnections[i] != null && _socketConnections[i].IsConnected())
                    {
                        _socketConnections[i].Close();
                        _socketConnections[i] = null;
                    }
                }

                //if (_fusionSocket != null && _fusionSocket.IsConnected()) {
                //    _fusionSocket.Close();
                //    _fusionSocket = null;
                //}

                if (_commanderSocket != null && _commanderSocket.IsConnected())
                {
                    _commanderSocket.Close();
                    _commanderSocket = null;
                }

                if (_ksimSocket != null && _ksimSocket.IsConnected())
                {
                    _ksimSocket.Close();
                    _ksimSocket = null;
                }

                if (_adeSocket != null && _adeSocket.IsConnected())
                {
                    _adeSocket.Close();
                    _adeSocket = null;
                }
            }
Exemple #2
0
 public void CloseServer()
 {
     _server.Close();
     OnServerClosed?.Invoke();
 }