Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Re: 'The session was closed before message transfer was complete' in duplex service

 
 
Thread Tools Display Modes
Old 03-04-2006   #1 (permalink)
Brent Dunham
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

>
>



 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Terminal Service session slow on Vista for just one server Hassan Vista General 8 11-24-2007 06:47 AM
HP6980 will not Automatically do Duplex with Duplex Hardware Dave Vista print fax & scan 1 07-07-2007 05:20 PM
Vista service - session 0 isolation Gene Vangampelaere Vista security 2 04-18-2007 02:20 PM
Vista service - session 0 isolation Gene Vangampelaere Vista General 4 04-17-2007 09:31 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50