Lawo.EmberPlusSharp.S101.S101Writer.DisposeAsync C# (CSharp) 메소드

DisposeAsync() 개인적인 메소드

private DisposeAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
리턴 Task
        public Task DisposeAsync(CancellationToken cancellationToken) =>
            this.taskSingleton.Execute(() => this.DisposeCoreAsync(cancellationToken));

Usage Example

        public void S101ReadTest()
        {
            AsyncPump.Run(
                async () =>
                {
                    byte[] input;

                    using (var stream = new MemoryStream())
                    {
                        var writer = new S101Writer(stream.WriteAsync, 1024);

                        using (var payloadStream = await writer.WriteMessageAsync(EmberDataMessage, CancellationToken.None))
                        {
                            var payload = new byte[BlockSize];
                            this.Random.NextBytes(payload);
                            await payloadStream.WriteAsync(payload, 0, payload.Length);
                            await payloadStream.DisposeAsync(CancellationToken.None);
                        }

                        await writer.DisposeAsync(CancellationToken.None);
                        input = stream.ToArray();
                    }

                    Console.WriteLine(
                        "S101Reader asynchronous: {0}ms",
                        await TimeMethod(count => TestS101ReaderAsync(input, count), LoopCount));
                });
        }
All Usage Examples Of Lawo.EmberPlusSharp.S101.S101Writer::DisposeAsync