// Use this for initialization private void Start() { // _client = new PitayaClient("ca.crt"); _client = new PitayaClient(); _connected = false; _requestSent = false; _client.NetWorkStateChangedEvent += (ev, error) => { if (ev == PitayaNetWorkState.Connected) { Debug.Log("Successfully connected!"); _connected = true; } else if (ev == PitayaNetWorkState.FailToConnect) { Debug.Log("Failed to connect"); } }; _client.Connect("127.0.0.1", 3251, new Dictionary <string, string> { { "oi", "mano" } }); }
private void OnDestroy() { if (_client != null) { _client.Dispose(); _client = null; } }