{"comment":{"created_at":"2011-10-26T21:23:15Z","body":"The errors were caused by accessing SignalR.Client.Connection from multiple threads at the same time. I protected the .Send() call with a lock and now it's working fine. I don't know if that's how you intended it to be done or if there's a bug in the SignalR client. Thanks","updated_at":"2011-10-26T21:23:15Z","url":"https://api.github.com/repos/SignalR/SignalR/issues/comments/2536656","id":2536656,"user":{"gravatar_id":"903b6e7caedc64b301bb6329188c4c4d","avatar_url":"https://secure.gravatar.com/avatar/903b6e7caedc64b301bb6329188c4c4d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/davideweaver","id":737309,"login":"davideweaver"}},"action":"created","issue":{"number":41,"created_at":"2011-10-12T22:06:13Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I have an ASP.NET MVC app hosting the chat sample (as seen on Hanselmann's blog post) which works great. I have another ASP.NET webforms app that get ~5 requests per second. The webforms app is using the Signalr client from the code behind and does a Connection.Send(msg) to the chat server when a request is received.\r\n\r\n99% of the time it works correctly, then I get the following exception on the webforms app:\r\n\r\n```javascript\r\n\r\nApplication ID: DefaultDomain\r\n\r\nProcess ID: 4520\r\n\r\nException: System.Runtime.Serialization.SerializationException\r\n\r\nMessage: Type 'Newtonsoft.Json.JsonReaderException' in Assembly 'Newtonsoft.Json, Version=4.0.2.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' is not marked as serializable.\r\n\r\nStackTrace:    at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)\r\n   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)\r\n   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)\r\n   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)\r\n   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object obj, MemoryStream stm)\r\n   at System.AppDomain.Serialize(Object o)\r\n   at System.AppDomain.MarshalObject(Object o)\r\n```\r\n\r\nwhich I think is coming from a thread spawned by the Signalr client. I then get the following unhandled exception from the MVC chat server:\r\n\r\n```javascript\r\nProtcol error: Missing client id.\r\n\r\nStack Trace\r\n\r\n[System.InvalidOperationException: Protcol error: Missing client id.]\r\nat SignalR.PersistentConnection.ProcessRequestAsync(HttpContext context)\r\nat SignalR.Web.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)\r\nat System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\nat System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)\r\n```\r\n\r\nThe exception on the chat server happens for a couple minutes, then the webforms app crashes w3wp.exe. I iisreset the webforms app and it works for another hour or so then happens again.\r\n\r\n\r\n","comments":2,"title":"Protcol error: Missing client id.","updated_at":"2011-10-26T21:23:16Z","url":"https://api.github.com/repos/SignalR/SignalR/issues/41","id":1894072,"assignee":null,"milestone":null,"closed_at":"2011-10-26T21:23:16Z","user":{"gravatar_id":"903b6e7caedc64b301bb6329188c4c4d","avatar_url":"https://secure.gravatar.com/avatar/903b6e7caedc64b301bb6329188c4c4d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/davideweaver","id":737309,"login":"davideweaver"},"html_url":"https://github.com/SignalR/SignalR/issues/41","labels":[],"state":"closed"},"legacy":{"issue_id":1894072,"comment_id":2536656}}