Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Timeout for method in service

 
 
Old 02-06-2007   #1 (permalink)
ottogbg


 
 

Timeout for method in service

I have a service (InstanceContextMode.Single) that has a couple of methods
accessible through a basicHttpBinding in WCF.

One of these methods is a "receive"-methods" which checks for new messages.
The method loops until a new message is ready, and then returns this message.

A TimeoutException is thrown when the client has waited for more than 1
minute (default value) for the receive-method to return. Each time that the
exception has been caught, the client calls the same method again.

The problem is that the method in the service keeps running, and will return
when a new message arrives, but the client never receives it.

So, is it possible to stop the execution of the method in the service if the
client has timed out, i.e. have them both time out after the same period of
time?

My System SpecsSystem Spec
Old 02-06-2007   #2 (permalink)
MobileMan


 
 

RE: Timeout for method in service

The simple answer to your question is "yes," but without knowing more about
what your application does my first question would be "is this the best
architecture?"

Is your client waiting to receive messages from your service, that are sent
to the service from some other process or method?

For example, your client is waiting to be notified that MSFT stock has hit a
specified value, and when that occurs your service will send the message to
the client.

Dumb example, but if this the general idea then you might want to consider a
publish & subscribe design, or possibly one-way calls instead.

Tell me more ..........
--
Stay Mobile


"ottogbg" wrote:

> I have a service (InstanceContextMode.Single) that has a couple of methods
> accessible through a basicHttpBinding in WCF.
>
> One of these methods is a "receive"-methods" which checks for new messages.
> The method loops until a new message is ready, and then returns this message.
>
> A TimeoutException is thrown when the client has waited for more than 1
> minute (default value) for the receive-method to return. Each time that the
> exception has been caught, the client calls the same method again.
>
> The problem is that the method in the service keeps running, and will return
> when a new message arrives, but the client never receives it.
>
> So, is it possible to stop the execution of the method in the service if the
> client has timed out, i.e. have them both time out after the same period of
> time?

My System SpecsSystem Spec
Old 02-06-2007   #3 (permalink)
Mariano Omar Rodriguez


 
 

Re: Timeout for method in service

It will be a better solution to make a contrack with a callback.

"ottogbg" <ottogbg@discussions.microsoft.com> wrote in message
news:7D543D0B-118F-4859-925D-BB61C3A80B64@microsoft.com...
>I have a service (InstanceContextMode.Single) that has a couple of methods
> accessible through a basicHttpBinding in WCF.
>
> One of these methods is a "receive"-methods" which checks for new
> messages.
> The method loops until a new message is ready, and then returns this
> message.
>
> A TimeoutException is thrown when the client has waited for more than 1
> minute (default value) for the receive-method to return. Each time that
> the
> exception has been caught, the client calls the same method again.
>
> The problem is that the method in the service keeps running, and will
> return
> when a new message arrives, but the client never receives it.
>
> So, is it possible to stop the execution of the method in the service if
> the
> client has timed out, i.e. have them both time out after the same period
> of
> time?


My System SpecsSystem Spec
Old 02-07-2007   #4 (permalink)
Arkady Frenkel


 
 

Re: Timeout for method in service

Add another method Stop() which you call on the service before client gone
so it will case your service stop to check messages and Start() for v.v
operation
Arkady

"ottogbg" <ottogbg@discussions.microsoft.com> wrote in message
news:7D543D0B-118F-4859-925D-BB61C3A80B64@microsoft.com...
>I have a service (InstanceContextMode.Single) that has a couple of methods
> accessible through a basicHttpBinding in WCF.
>
> One of these methods is a "receive"-methods" which checks for new
> messages.
> The method loops until a new message is ready, and then returns this
> message.
>
> A TimeoutException is thrown when the client has waited for more than 1
> minute (default value) for the receive-method to return. Each time that
> the
> exception has been caught, the client calls the same method again.
>
> The problem is that the method in the service keeps running, and will
> return
> when a new message arrives, but the client never receives it.
>
> So, is it possible to stop the execution of the method in the service if
> the
> client has timed out, i.e. have them both time out after the same period
> of
> time?



My System SpecsSystem Spec
Old 02-07-2007   #5 (permalink)
ottogbg


 
 

Re: Timeout for method in service

"MobileMan" wrote:
> The simple answer to your question is "yes," but without knowing more about
> what your application does my first question would be "is this the best
> architecture?"
>
> Is your client waiting to receive messages from your service, that are sent
> to the service from some other process or method?
>
> For example, your client is waiting to be notified that MSFT stock has hit a
> specified value, and when that occurs your service will send the message to
> the client.
>
> Dumb example, but if this the general idea then you might want to consider a
> publish & subscribe design, or possibly one-way calls instead.
>
> Tell me more ..........


True, that is basically the concept. See below.

"Mariano Omar Rodriguez" wrote:
> It will be a better solution to make a contrack with a callback.


I have considered callbacks, and it does the work really well, the problem
is compability with WS-clients. I have not been able to consume a
wsDualHttpBinding in a Java client. That is why I have this design.

"Arkady Frenkel" wrote:
> Add another method Stop() which you call on the service before client gone
> so it will case your service stop to check messages and Start() for v.v
> operation
> Arkady


That can work, although the callback approach would work.

Thanks!
My System SpecsSystem Spec
Old 02-07-2007   #6 (permalink)
Mariano Omar Rodriguez


 
 

Re: Timeout for method in service

Then, I believe that you could use another WebMethod that making poolling
reports the status of the complition of the task.


"ottogbg" <ottogbg@discussions.microsoft.com> wrote in message
news:8BD8C6EF-C8FB-4B86-A5D5-34D3426BE61E@microsoft.com...
> "MobileMan" wrote:
>> The simple answer to your question is "yes," but without knowing more
>> about
>> what your application does my first question would be "is this the best
>> architecture?"
>>
>> Is your client waiting to receive messages from your service, that are
>> sent
>> to the service from some other process or method?
>>
>> For example, your client is waiting to be notified that MSFT stock has
>> hit a
>> specified value, and when that occurs your service will send the message
>> to
>> the client.
>>
>> Dumb example, but if this the general idea then you might want to
>> consider a
>> publish & subscribe design, or possibly one-way calls instead.
>>
>> Tell me more ..........

>
> True, that is basically the concept. See below.
>
> "Mariano Omar Rodriguez" wrote:
>> It will be a better solution to make a contrack with a callback.

>
> I have considered callbacks, and it does the work really well, the problem
> is compability with WS-clients. I have not been able to consume a
> wsDualHttpBinding in a Java client. That is why I have this design.
>
> "Arkady Frenkel" wrote:
>> Add another method Stop() which you call on the service before client
>> gone
>> so it will case your service stop to check messages and Start() for v.v
>> operation
>> Arkady

>
> That can work, although the callback approach would work.
>
> Thanks!


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
No timeout for stop-service cmdlet? PowerShell
.net Windows Service Won't Start - Timeout .NET General
Controlling service restart timeout with WMI VB Script
Windows Service Timeout in Vista Vista General


Vista Forums 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 Ltd

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