SilverlightShow: Windows Phone + SignalR = Awesome Possibilities! Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) Re: Windows Phone + SignalR = Awesome Possibilities! <p>Hi,<br /> <br /> I'm just find this great example of usage of SignalR and Windows Phone 7.<br /> I downloaded the example, runned the server ASP.NET application and WP7 application too with emulator (WP7.1). And after I try to send a message I get this error message in server project:<br /> Newtonsoft.Json.JsonReaderException: {"Additional text encountered after finished reading JSON content: ,. Line 1, position 2."}<br /> <br /> I tried twice, restarted the server and the client and when I click the chat button I get this error:<br /> InvalidOperatorException was unhandled: Start must be called before data can sent.<br /> This error happened at the client's code:<br /> <code></p> <p>private void ChatBackgroundDataWorker_DoWork(object sender, DoWorkEventArgs e)<br />         {<br />             // Post message to server chatroom.<br />             SignalRServerHub.Invoke("PushMessageToClients", chatMessage).Wait();<br />             chatMessage = string.Empty;<br />         }</p> <p><code></p> <p>What is wrong? Could you please help me, what would be the problem?</p> <p><br /> </p> http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx#comment9509 balee22 http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx Mon, 17 Jun 2013 17:20:11 GMT Re: Windows Phone + SignalR = Awesome Possibilities! <p>that looks great! i'll definitely give that a try!</p> <p><br /> </p> http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx#comment8107 joshpollard http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx Thu, 31 May 2012 17:42:38 GMT Re: Windows Phone + SignalR = Awesome Possibilities! <p>joshpollard,</p> <p>Since you had asked about SignalR connectivity, hoping you saw this: <a href="http://wp7signalrhelper.codeplex.com/">http://wp7signalrhelper.codeplex.com/</a>. You can completely control what gets exchanged between client & server, including objects. Please see source code.</p> <p>Thanks!</p> http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx#comment8104 samidip http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx Wed, 30 May 2012 20:58:56 GMT Re: Windows Phone + SignalR = Awesome Possibilities! Thanks for checking. It seems really weird to me that my server is sending 2 strings to all clients, but WP7 clients only receive the first string. http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx#comment7840 joshpollard http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx Sat, 14 Apr 2012 13:47:17 GMT Re: Windows Phone + SignalR = Awesome Possibilities! <p>joshpollard,</p> <p>Thanks for the comment & great question. The problem that we run into is the fact that unlike web clients, which the server can reach out to & invoke JavaScript functions on, there isn't, in my knowledge, any way for the SignalR server to invoke methods on .NET clients directly. We can rig the "on" event-handler to fire with some trigger on the server; but it only sends in a string. Now, having said that, you could pass in anything from the server as a string to the Windows Phone client app .. it could a serialized object, concatenated strings etc. I'll look around to check if there are any better solutions to this.</p> <p>Thanks!</p> http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx#comment7838 samidip http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx Sat, 14 Apr 2012 08:22:55 GMT Re: Windows Phone + SignalR = Awesome Possibilities! <p>This is a great sample, and it helped me a lot! I do have one question though, how would you send multiple pieces of data to the clients? For example, it would be really nice if it would display who sent the message. Your "On" method only returns a string, what if I wanted it to accept two strings (one for the chat message and one for the name of the person who sent it)?</p> <p>Thanks!</p> http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx#comment7837 joshpollard http://www.silverlightshow.net/items/Windows-Phone-SignalR-Awesome-Possibilities.aspx Sat, 14 Apr 2012 06:30:02 GMT