I'm seeing a really odd error that I don't know enough about SharedCache to explain.
When I do a request from the client, The server ends up throwing this exception:
The type initializer for 'SharedCache.WinService.ServiceLogic' threw an exception.
at SharedCache.WinService.TcpServer.HandleClientMessage(SharedCacheStateObject state) in C:\zip_code_cs_25909_release_220.127.116.11\SharedCache.WinService\TcpServer.cs:line 872
This property has already been set and cannot be modified.
at System.Threading.Thread.set_Name(String value)
at SharedCache.WinService.TcpServerReplication..ctor() in C:\zip_code_cs_25909_release_18.104.22.168\SharedCache.WinService\TcpServerReplication.cs:line 145
at SharedCache.WinService.ServiceLogic..cctor() in C:\zip_code_cs_25909_release_22.214.171.124\SharedCache.WinService\ServiceLogic.cs:line 73
Looking at the code at these lines, it looks like TcpServerReplication is trying to name the thread:
However, the thread is already named "TcpServer (static)", so it can't set the name again.
Thread.CurrentThread.Name = "TcpServerReplication";
More importantly, the place that this exception is thrown in TcpServer.HandleClientMessage() causes it to exit without closing the Socket's response, so the client how hangs indefinitely trying to read the Socket response! Looking at that method, and the
way the Socket is passed around to different delegates, there are probably a few other places where an unhandled exception will cause the client to hang because the socket's response is never closed.
Anyone have any ideas? Thanks for any help!