예제 #1
0
            public void Send(ITransportListener listener, IList <IMutableMessage> messages, int clientTimeout = ClientTransport.DEFAULT_TIMEOUT)
            {
                foreach (var message in messages)
                {
                    if (message.Id == null)
                    {
                        message.Id = _bayeuxClient.NewMessageId();
                    }

                    if (ClientId != null)
                    {
                        message.ClientId = ClientId;
                    }

                    if (!_bayeuxClient.ExtendSend(message))
                    {
                        messages.Remove(message);
                    }
                }

                if (messages.Count > 0)
                {
                    Transport.Send(listener, messages, clientTimeout);
                }
            }
            public void Send(ITransportListener listener, IList <IMutableMessage> messages)
            {
                foreach (var message in messages)
                {
                    if (message.Id == null)
                    {
                        message.Id = bayeuxClient.NewMessageId();
                    }

                    if (clientId != null)
                    {
                        message.ClientId = clientId;
                    }

                    if (!bayeuxClient.ExtendSend(message))
                    {
                        messages.Remove(message);
                    }
                }
                if (messages.Count > 0)
                {
                    transport.Send(listener, messages);
                }
            }