--
Всего хорошего.
Отправлено с iPhone
09.11.2010, в 18:42, Neil Mosafi <nmo...@gmail.com> написал(а):
protected void Application_Start()
{
// ...
Setup.AspComet.InANonExtensibleAndNonConfigurableManner();
AspComet.Eventing.EventHub.Subscribe<PublishingEvent>(CometServ.OnMessage);
CometServ.CometClients = ServiceLocator.Current.GetInstance<IClientRepository>();
}
And I'm have an exception: "DummyServiceLocator does not support retrieving anything but the message bus"
Yes should be fine. Once you enqueue the message, flush the queue,
that will cause the message to be sent immediately and his browser
will start a new long polling connection straight away after receiving
it, ready for the next message.
public static void Enqueue(this IClient client, string sender, string channel, string message)
{
Dictionary<string, string> MsgData = new Dictionary<string,string>();
MsgData.Add("sender", sender);
MsgData.Add("message", message);
Message Msg = new Message();
Msg.channel = channel;
Msg.data = MsgData;
client.Enqueue(Msg);
client.FlushQueue();
}
This allows send message to client from server-side
I want use AspComet to push some data from server to clients in real time
How did you get on with this?
public void CompleteRequestWithMessages(IEnumerable<Message> responseMessages)
{
this.responseMessages = responseMessages;
this.IsCompleted = true;
try
{
this.callback(this);
}
catch (Exception)
{
}
}
Sounds like some transport issues. What web server are you using? How
many clients are connecting? Where are the clients - any proxy server,
NAT, etc?