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 - Client/Server event/callback timeout

 
 
Old 10-16-2007   #1 (permalink)
Josh


 
 

Client/Server event/callback timeout

We have a standard client/server scenario.

Clients connect to a server and subscribe to certain events.
The server fires these events and the clients react accordingly.
The events are not frequent, maybe once a day, sometimes as little as
once a month.

The channel times out after the default 10 minutes. (We're using
NetNamedPipesBinding now, but will be moving to NetTcpBinding as we
scale.)

I found that I can set this timeout value, the ReceiveTimeout property
on the binding (either programmatically or in the app.config file).
(How does this differ from the InactivityTimeout of the
ReliableSession on the binding?)

Obviously in a publish/subscribe scenario we want the clients to be
listening indefinitely. While there is no way to specify an infinite
timeout, I can set it to a maximum value of just over 24 days
(24.20:31:23.6470000). This value is actually not long enough for our
purposes. (Our customers will start a client and leave it running
easily for a month.)

First question: Is this the only way to adjust how long a channel will
listen before closing itself? Surely there are other client/server
applications out there that need to have a permanent channel
established to listen for events?

Second question: Is this really the correct way of establishing a two
way conversation with a server? Once we start to scale up to a few
hundred clients, this means we would have a few hundred permanently
open channels to the server. Will we run into resource problems?

We've also considered that maybe we should make each client its own
WCF server. They would subscribe to the server by sending the name of
their specific channel (endpoint address). When the server had an
event to send it would open up each specific channel to each client
and send the event to the client. Using this method we would not need
to keep a few hundred channel open at a time, nor would we run into
any issues of the channel timing out after 24 days.

Final question: Would this last method work/scale better or are there
other gotcha's with it?

Thanks,
- Josh


My System SpecsSystem Spec
Old 10-18-2007   #2 (permalink)
Joe-P


 
 

RE: Client/Server event/callback timeout


You are using the ReceiveTimeout correctly. InactivityTimeout is part of
the Reilable Session. It is used when the ordered property is set to true. If
a message has not arrived within a the specified time in the
InactivityTimeout then the WCF Runtime would send a termination message to
the client and then terminates the session and discards all the messages it
recieved during that session.

To acheive the capability of "perpetual" session it would be better for the
client to maintain the session more than having the burden on the server. My
suggestion would be to have a "ping" like a dummy message sent to the server
at a set time hence keeping the session alive. Thereby easing the scalability
issues on the server side.

"Josh" wrote:
Quote:

> We have a standard client/server scenario.
>
> Clients connect to a server and subscribe to certain events.
> The server fires these events and the clients react accordingly.
> The events are not frequent, maybe once a day, sometimes as little as
> once a month.
>
> The channel times out after the default 10 minutes. (We're using
> NetNamedPipesBinding now, but will be moving to NetTcpBinding as we
> scale.)
>
> I found that I can set this timeout value, the ReceiveTimeout property
> on the binding (either programmatically or in the app.config file).
> (How does this differ from the InactivityTimeout of the
> ReliableSession on the binding?)
>
> Obviously in a publish/subscribe scenario we want the clients to be
> listening indefinitely. While there is no way to specify an infinite
> timeout, I can set it to a maximum value of just over 24 days
> (24.20:31:23.6470000). This value is actually not long enough for our
> purposes. (Our customers will start a client and leave it running
> easily for a month.)
>
> First question: Is this the only way to adjust how long a channel will
> listen before closing itself? Surely there are other client/server
> applications out there that need to have a permanent channel
> established to listen for events?
>
> Second question: Is this really the correct way of establishing a two
> way conversation with a server? Once we start to scale up to a few
> hundred clients, this means we would have a few hundred permanently
> open channels to the server. Will we run into resource problems?
>
> We've also considered that maybe we should make each client its own
> WCF server. They would subscribe to the server by sending the name of
> their specific channel (endpoint address). When the server had an
> event to send it would open up each specific channel to each client
> and send the event to the client. Using this method we would not need
> to keep a few hundred channel open at a time, nor would we run into
> any issues of the channel timing out after 24 days.
>
> Final question: Would this last method work/scale better or are there
> other gotcha's with it?
>
> Thanks,
> - Josh
>
>
My System SpecsSystem Spec
Old 04-23-2008   #3 (permalink)


Vista Business 32bit
 
 

Re: Client/Server event/callback timeout

That's exactly what I am trying to do as well. I was thinking along the lines of broadcasting a UDP message for events occuring on the server - all the clients would pick that up. (Rather than maintaining a list of client EndpointAddresses on the server).
My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
How Can a Server Raise an Event at a Client (Remoting) .NET General
Event callback on thread PowerShell


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