public void Dispose() { Debug.Log(string.Format("PitayaClient Disposed {0}", _client)); if (_disposed) { return; } if (_eventManager != null) { _eventManager.Dispose(); } _reqUid = 0; PitayaBinding.Disconnect(_client); PitayaBinding.Dispose(_client); _client = IntPtr.Zero; _disposed = true; }
private void Init(string certificateName, bool enableTlS, bool enablePolling, bool enableReconnect, int connTimeout) { _eventManager = new EventManager(); _typeRequestSubscriber = new TypeSubscriber <uint>(); _typePushSubscriber = new TypeSubscriber <string>(); _client = PitayaBinding.CreateClient(enableTlS, enablePolling, enableReconnect, connTimeout, this); if (certificateName != null) { #if UNITY_EDITOR if (File.Exists(certificateName)) { PitayaBinding.SetCertificatePath(certificateName); } else { PitayaBinding.SetCertificateName(certificateName); } #else PitayaBinding.SetCertificateName(certificateName); #endif } }
public void Connect(string host, int port, Dictionary <string, string> handshakeOpts) { var opts = Pitaya.SimpleJson.SimpleJson.SerializeObject(handshakeOpts); PitayaBinding.Connect(_client, host, port, opts); }
public void Connect(string host, int port, string handshakeOpts = null) { PitayaBinding.Connect(_client, host, port, handshakeOpts); }
public static void SetLogLevel(PitayaLogLevel level) { PitayaBinding.SetLogLevel(level); }
public void Disconnect() { PitayaBinding.Disconnect(_client); }
public void Notify(string route, int timeout, string msg) { PitayaBinding.Notify(_client, route, JsonSerializer.Encode(msg), timeout); }
public void Notify(string route, int timeout, IMessage msg) { var serializer = PitayaBinding.ClientSerializer(_client); PitayaBinding.Notify(_client, route, ProtobufSerializer.Encode(msg, serializer), timeout); }
public void Connect(string host, int port) { PitayaBinding.Connect(_client, host, port); }