I wrote a simple SignalR hub:
public void PostUpdate(string message) { try { var update = URS.Tools.JsonSerializer.DeserializeFromJson<DataUpdate>(message); switch (update.UpdateType) { case DataUpdateType.Opportunity: Clients.All.UpdateOpportunity(update.DataUpdateId); break; case DataUpdateType.Contact: Clients.All.UpdateContact(update.DataUpdateId); break; case DataUpdateType.Client: Clients.All.UpdateClient(update.DataUpdateId); break; } } catch (Exception exception) { Logger.LogError(exception); } }
It works with the Silverlight 5 client. For the most part, it works, but after 5-30 minutes I get an error message:
Exception information: Exception type: FormatException Exception message: Invalid cursor. at Microsoft.AspNet.SignalR.Messaging.Cursor.GetCursors(String cursor, Func`2 keyMaximizer) at Microsoft.AspNet.SignalR.Messaging.DefaultSubscription..ctor(String identity, IEnumerable`1 eventKeys, TopicLookup topics, String cursor, Func`2 callback, Int32 maxMessages, IStringMinifier stringMinifier, IPerformanceCounterManager counters) at Microsoft.AspNet.SignalR.Messaging.MessageBus.CreateSubscription(ISubscriber subscriber, String cursor, Func`2 callback, Int32 messageBufferSize) at Microsoft.AspNet.SignalR.Messaging.MessageBus.Subscribe(ISubscriber subscriber, String cursor, Func`2 callback, Int32 maxMessages) at Microsoft.AspNet.SignalR.Infrastructure.Connection.Receive(String messageId, Func`2 callback, Int32 maxMessages) at Microsoft.AspNet.SignalR.Transports.ForeverTransport.ProcessMessages(ITransportConnection connection, Func`1 postReceive, Action`1 endRequest)
When I look at packets, I do not see the difference between the one that was before the error and the successful call. It starts serverEvents, but I tried longPolling to no avail.
An exception occurs on the server.
Any ideas that might cause the above error and / or how to solve it?
Steve source share