Exemple #1
0
 public void Send(Function func, long id)
 {
     if (ptr == IntPtr.Zero)
     {
         throw new ObjectDisposedException(nameof(Binding));
     }
     td_bridge_client_send(ptr, id, TLObjectFactory.CreateCxxObject(func));
 }
Exemple #2
0
            public TLObject Execute(Function func)
            {
                TLObject obj = null;
                var      ptr = td_bridge_client_execute(TLObjectFactory.CreateCxxObject(func));

                if (ptr != IntPtr.Zero)
                {
                    obj = TLObjectFactory.FetchAndFreeCxxObject(ptr);
                }
                return(obj);
            }
Exemple #3
0
            public (long, TLObject) Receive(double timeout)
            {
                //var objptr = td_bridge_client_receive(ptr, timeout, out var id);
                //return (id, FetchAndFreeObject(objptr));
                if (ptr == IntPtr.Zero)
                {
                    throw new ObjectDisposedException(nameof(Binding));
                }
                TLObject obj = null;
                long     id  = 0;

                td_bridge_client_receive(ptr, timeout, out id);
                if (ptr != IntPtr.Zero)
                {
                    obj = TLObjectFactory.FetchAndFreeCxxObject(ptr);
                }
                return(id, obj);
            }