コード例 #1
0
ファイル: Connection.cs プロジェクト: cdegroc/tinkerpop
        private async Task SendMessageAsync(RequestMessage message)
        {
            if (_sessionEnabled)
            {
                message = RebuildSessionMessage(message);
            }
            var serializedMsg = await _messageSerializer.SerializeMessageAsync(message).ConfigureAwait(false);

            await _webSocketConnection.SendMessageAsync(serializedMsg).ConfigureAwait(false);
        }
コード例 #2
0
ファイル: Connection.cs プロジェクト: olivertowers/tinkerpop
        private async Task SendMessageAsync(RequestMessage message)
        {
            if (_sessionEnabled)
            {
                message = RebuildSessionMessage(message);
            }
            var serializedMsg = await _messageSerializer.SerializeMessageAsync(message).ConfigureAwait(false);

#if NET6_0_OR_GREATER
            if (message.Processor == Tokens.OpsAuthentication)
            {
                // Don't compress a message that contains credentials to prevent attacks like CRIME or BREACH
                await _webSocketConnection.SendMessageUncompressedAsync(serializedMsg).ConfigureAwait(false);

                return;
            }
#endif
            await _webSocketConnection.SendMessageAsync(serializedMsg).ConfigureAwait(false);
        }