AK.F1.Timing.Server.Proxy.ProxySession.SendAsync C# (CSharp) Метод

SendAsync() публичный Метод

Begins an asynchronous operation to send the specified buffer.
/// Thrown when the this instance has been disposed of. ///
public SendAsync ( ByteBufferSnapshot buffer ) : void
buffer AK.F1.Timing.Server.IO.ByteBufferSnapshot The buffer to send.
Результат void
        public void SendAsync(ByteBufferSnapshot buffer)
        {
            CheckDisposed();
            _bufferQueue.Enqueue(buffer);
            SendNextBufferIfNotBusy();
        }

Same methods

ProxySession::SendAsync ( IEnumerable buffers ) : void

Usage Example

Пример #1
0
        public void can_send_a_buffer()
        {
            using(var ctx = new TestContext())
            using(var session = new ProxySession(0, ctx.Output))
            {
                var expected = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

                session.SendAsync(new[] { expected });

                var actual = new byte[expected.Length];
                Assert.Equal(ctx.Input.Receive(actual), expected.Length);
                Assert.Equal(expected, actual);
                Assert.False(ctx.Input.Poll(PollTimeout, SelectMode.SelectRead));
            }
        }
All Usage Examples Of AK.F1.Timing.Server.Proxy.ProxySession::SendAsync