Ejemplo n.º 1
0
        public void Stop()
        {
            NativeIPCClientImpl.StopLoop(thread);

            NativeIPCClientImpl.Release(handle);
            handle = IntPtr.Zero;
        }
Ejemplo n.º 2
0
        public void Start()
        {
            handle = NativeIPCClientImpl.CreateIPCClient(onIncomingMessage, onConnected, onDisconnected);
            thread = NativeIPCClientImpl.StartLoop(handle);

            NativeIPCClientImpl.Connect(handle, "org.cloudveil.filterserviceprovider");
        }
Ejemplo n.º 3
0
        public void PushMessage(BaseMessage msg)
        {
            IFormatter formatter = new BinaryFormatter();

            using (MemoryStream stream = new MemoryStream())
            {
                formatter.Serialize(stream, msg);

                byte[] arr = stream.ToArray();

                bool isBroadcast = msg is ClientToClientMessage;

                NativeIPCClientImpl.Send(handle, arr, arr.Length, isBroadcast);
            }
        }
Ejemplo n.º 4
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                }

                if (handle != IntPtr.Zero)
                {
                    NativeIPCClientImpl.Release(handle);
                    handle = IntPtr.Zero;
                }

                disposedValue = true;
            }
        }