![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| Guest | Re: 'The session was closed before message transfer was complete' in duplex service Thanks for your repsonse Juvial. I found it does have to do with Windows Forms context, Not running the client on the UI thread is best answer for my situation as the reason I even ran into this is laziness! ![]() thanks, Brent "Ido Samuelson" <idos@magen.com> wrote in message news:3e64290452513c8c7de5674d98e14@news.microsoft.com... > Sounds like a feature that I would need. > Hello Juval, > > > Best Regards, > > Ido Samuelson > Senior consultant > Advantech (Magen MTC) > mailto:idos@magen.com > >> If I understand your situation correctly, you have (as you should >> have) a >> deadlock. If the client is on the UI thread (actually, any thread that >> has >> the .NET 2.0 Windows Forms context, even if it does not pump messages >> yet), >> and you start a duplex session, then while you make a call to the >> service, >> the service cannot call you back because that callback is converted to >> a >> Windows message, and you are not pumping messages because you are in >> the >> middle of a call-out. >> You could do the following: >> 1. Mark the callback operation as one-way >> 2. Mark the callout as one-way (not possible usually) >> 3. Not run the client on the UI thread >> 4. Designate a different object as the callback (not 'this' for the >> callback >> instance) and have that object communicate back to the client >> asynchronously >> 5. Wait for the next CTP (the WCF team can elaborate more if they want >> - I >> cannot). >> Hope that helps, >> >> Juval. >> >> "Brent Dunham" <bdunham@conexis.com> wrote in message >> news:umu3hGWDGHA.1032@TK2MSFTNGP11.phx.gbl... >> >>> Well, after no response I dug a little deeper, and discovered the >>> issue. Turns out I couldn't consume a duplex service on the UI >>> thread. I created a new thread after wrapping proxy instanciation and >>> method invocation into a class. Has anyone ran into this? All samples >>> I've seen on duplex are console based. >>> >>> "Brent Dunham" <bdunham@conexis.com> wrote in message >>> news:OKJn6JADGHA.2436@TK2MSFTNGP15.phx.gbl... >>> >>>> Hi, >>>> I've written a simple duplex service but every call to service >>>> results in >>>> the exception >>>> 'The session was closed before message transfer was complete' >>>> >>>> I can't find any info on this message and it's got me stumped. The >>>> 1st >>>> callback method invocation happens AFTER the exception is caught >>>> indicating that the callbacks happen on a different thread than >>>> service >>>> client code. If anyone has run into this or has knowledge ti would >>>> be >>>> VERY helpful. >>>> thanks, >>>> Brent > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Local Session Manager Service | General Discussion | |||
| Fax Service Stopper working and was closed | Vista print fax & scan | |||
| HP6980 will not Automatically do Duplex with Duplex Hardware | Vista print fax & scan | |||
| Vista service - session 0 isolation | Vista security | |||
| Vista service - session 0 isolation | Vista General | |||