Hazelcast.Client.Spi.ClientInvocationService.TrySend C# (CSharp) Method

TrySend() private method

private TrySend ( ClientInvocation clientInvocation, ClientConnection connection ) : bool
clientInvocation ClientInvocation
connection ClientConnection
return bool
        private bool TrySend(ClientInvocation clientInvocation, ClientConnection connection)
        {
            var correlationId = clientInvocation.Message.GetCorrelationId();
            if (!TryRegisterInvocation(correlationId, clientInvocation)) return false;

            //enqueue to write queue
            if (connection.WriteAsync((ISocketWritable) clientInvocation.Message))
            {
                return true;
            }

            //Rollback sending failed
            if (Logger.IsFinestEnabled())
            {
                Logger.Finest("Unable to write request " + clientInvocation.Message + " to connection " + connection);
            }
            UnregisterInvocation(correlationId);
            RemoveEventHandler(correlationId);
            return false;
        }