コード例 #1
0
ファイル: BayeuxClient.cs プロジェクト: kdcllc/CometD.NetCore
            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);
                }
            }
コード例 #2
0
            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);
                }
            }