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)); }
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); }
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); }