Esempio n. 1
0
        public void StartCall(string methodName, CallSafeHandle call, CompletionQueueSafeHandle cq)
        {
            // We don't care about the payload type here.
            AsyncCall <byte[], byte[]> asyncCall = new AsyncCall <byte[], byte[]>(
                (payload) => payload, (payload) => payload);


            asyncCall.InitializeServer(call);

            var finishedTask = asyncCall.ServerSideStreamingRequestCallAsync(new NullObserver <byte[]>());

            // TODO: this makes the call finish before all reads can be done which causes trouble
            // in AsyncCall.HandleReadFinished callback. Revisit this.
            asyncCall.SendStatusFromServerAsync(new Status(StatusCode.Unimplemented, "No such method.")).Wait();

            finishedTask.Wait();
        }