wcf - Silverlight PollingDuplex InnerChannel faulted with multipleMessagesPerPoll (serverPollTimeout) -


im running silverlight client version 4.0.50917.0 , sdk version 4.0.50826.1

i've created simple silverlight client against wcf pollingduplex binding:

web.config:

<system.servicemodel> <extensions>   <bindingextensions>     <add name="pollingduplexhttpbinding"         type="system.servicemodel.configuration.pollingduplexhttpbindingcollectionelement,system.servicemodel.pollingduplex, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" />   </bindingextensions> </extensions> <behaviors>   <servicebehaviors>     <behavior name="sv">       <servicemetadata httpgetenabled="true" />       <servicedebug includeexceptiondetailinfaults="true" />       <servicethrottling maxconcurrentsessions="2147483647"/>     </behavior>   </servicebehaviors> </behaviors>  <bindings>   <!-- create polling duplex binding. -->   <pollingduplexhttpbinding>     <binding name="multiplemessagesperpollpollingduplexhttpbinding"              duplexmode="multiplemessagesperpoll"              maxoutputdelay="00:00:01"/>      <binding name="singlemessageperpollpollingduplexhttpbinding"              maxoutputdelay="00:00:01"/>   </pollingduplexhttpbinding> </bindings> <services>   <service behaviorconfiguration="sv" name="backend.guipollingservice">     <endpoint address="" binding="pollingduplexhttpbinding" bindingconfiguration="singlemessageperpollpollingduplexhttpbinding"       contract="backend.iguipollingservice" />     <endpoint address="mmpp" binding="pollingduplexhttpbinding" bindingconfiguration="multiplemessagesperpollpollingduplexhttpbinding"       name="multimessage" contract="backend.iguipollingservice" />     <endpoint address="mex" binding="mexhttpbinding" contract="imetadataexchange" />   </service> </services> <servicehostingenvironment multiplesitebindingsenabled="true" /> 

my silverlight client connect this:

 string endpointaddress2 = "http://"           + app.current.host.source.dnssafehost           + ":"           + app.current.host.source.port.tostring(cultureinfo.invariantculture)           + "/guipollingservice.svc/mmpp";  this.client = new guiclientproxy.guipollingserviceclient(         new pollingduplexhttpbinding(pollingduplexmode.multiplemessagesperpoll),          new endpointaddress(endpointaddress2)) 

i got eventhandler innerchannel faulted:

client.innerchannel.faulted += new eventhandler(innerchannel_faulted); 

...

void innerchannel_faulted(object sender, eventargs e)     {          dispatcher.begininvoke(() =>         { status.text += "inner channel faulted\n\n"         }     }  

when using above client.innerchannelfaulted event happens after one serverpolltimeout. (default 15seconds, verified fiddler)

if switch client connect this:

string endpointaddress2 = "http://"           + app.current.host.source.dnssafehost           + ":"           + app.current.host.source.port.tostring(cultureinfo.invariantculture)           + "/guipollingservice.svc";  this.client = new guiclientproxy.guipollingserviceclient(         new pollingduplexhttpbinding(),          new endpointaddress(endpointaddress2)) 

aka single message per poll fiddler reveals after each serverpolltimeout new poll started , channel not faulted.

any ideas what's wrong here?

edit:

i have read http://social.msdn.microsoft.com/forums/en/wcf/thread/1e6aa407-4446-4d4a-8dac-5392250814b8 , http://forums.silverlight.net/forums/p/200659/468206.aspx#468206 , agree "singlemessageperpoll" not decent workaround. can see on versions running recent versions of sdk , developer runtime.

edit2:

i found out, if use google chrome browser instead of ie8 multiplemessagesperpoll works fine! me smells runtime vs. ie8 bug?

edit3:

an confirmed on silverlight ws blog: http://blogs.msdn.com/b/silverlightws/archive/2010/12/15/pollingduplex-using-multiplemessagesperpoll-issue-in-latest-sl4-gdrs.aspx

i confirm issue on sample, same sdk , client versions.

the issue has more implications on other browsers too: under impression multiplemessageperpoll doesn't seem work correctly on them neither (fiddler , firebug show looks lot singlemessageperpoll)

however make work using client network stack (bypassing browser network stack). solution far perfect, cookies must set manually in case. can can annoying or non-issue depending on application.

to perform http request through client stack, use before start service calls:

httpwebrequest.registerprefix("http://", webrequestcreator.clienthttp); 

you little more specific, according needs.

if has more satisfying answer, glad read it. if interested in reproducing probleme, have modified old tomek sample use multiplemessageperpoll on sl4 instead of singlemessageperpoll on sl3.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -