Пример #1
0
        public async Task PongAsync()
        {
            ThrowIfDisposed();

            var cmdPayload = PongCmd.Generate();

            await _connection.WithWriteLockAsync(async writer =>
            {
                await writer.WriteAsync(cmdPayload).ConfigureAwait(false);
                await writer.FlushAsync().ConfigureAwait(false);
            }).ConfigureAwait(false);
        }
Пример #2
0
        public void Pong()
        {
            ThrowIfDisposed();

            var cmdPayload = PongCmd.Generate();

            _connection.WithWriteLock(writer =>
            {
                writer.Write(cmdPayload);
                writer.Flush();
            });
        }