예제 #1
0
        /// <summary>
        /// Call blocks until the result is received. Use Send for a nonblocking call.
        /// </summary>
        /// <param name="notify">Call</param>
        /// <returns>Result or null if failed</returns>
        protected Notify Call(Notify notify)
        {
            var callresult = new CallResultWait(notify, true);
            lock (WaitLock)
            {
                WaitInvokeList.Add(callresult);
            }
            notify.InvokeId = CurrentInvoke.Increment();

            SendPacket(notify);

            callresult.Wait.WaitOne(-1);
            return callresult.Result;
        }