public void CloseServer() { if (server != null) { server.Close(); server = null; } }
public void OpenServer(int port = 49983) { #if UNITY_EDITOR if (PlayerSettings.runInBackground == false) { Debug.Log("Suggest setting PlayerSettings runInBackground = true"); } #endif CloseServer(); server = new IFMServer(port); server.PacketReceivedEvent += OnPacketReceived; }