Пример #1
0
        /// <summary>
        /// 1. serializes an <see cref="IIpcOperation"/> over via <paramref name="stream"/>;
        /// 2. if the operation is synchronous, reads an <see cref="IIpcResult"/> from <paramref name="stream"/>.
        /// </summary>
        internal static async Task <IIpcResult> SendOperationAndExecuteRemotelyAsync(IIpcOperation operation, Stream stream, CancellationToken token)
        {
            await IpcOperation.SerializeAsync(stream, operation, token);

            return(operation.ShouldWaitForServerAck
                ? await IpcResult.DeserializeAsync(stream, token)
                : IpcResult.Success());
        }