all groups > dotnet remoting > august 2006 >
You're in the

dotnet remoting

group:

Problem with delay


Problem with delay oskar NO[at]SPAM musiker.nu
8/18/2006 12:46:07 AM
dotnet remoting:
I have created an application that consists of a server running as a
service on a hardware server and 11 clients running on different
computers. The server and the client computers are all on the same
subnet with a couple of switches in between. Every 80 seconds the
server calls each of the clients to verify that they still are up and
running, and this is where my problem is: Sometimes one of these calls
takes up to 3 seconds to complete. I'll make a simple illustration:

This is how it sometimes works and always should work:
* Call to client 1: approx. 1 ms
* Call to client 2: approx. 1 ms
* Call to client 3: approx. 1 ms
....
* Call to client 11: approx. 1 ms

But this is what often happens:
* Call to client 1: approx. 1 ms
* Call to client 2 (or any other station): approx. 3000 ms
* Call to client 3: approx. 1 ms
....
* Call to client 11: approx. 1 ms

The method that is called does nothing, and is encapsulated in a try -
catch statement. If an exception is thrown it is assumed that the
client no longer is running.

Is there anyone that has had similar problems? Any clue or idea would
make me very happy.

/Oskar
Re: Problem with delay Goran Sliskovic
8/19/2006 3:02:50 PM
[quoted text, click to view]

Hi,
I see nothing wrong with this. Please note that remoting uses network
transport (TCP/IP), which does not guarantee response time. It may
happen that occasionally packet is lost requiring retransmissions. That
may take some time, especially if network is congested or there is some
hardware problem. No network protocol is immune to packet loss. TCP/IP
does retransmission in that case and it may take some time to recover
(this is by design).

Regards,
Re: Problem with delay oskar NO[at]SPAM musiker.nu
8/24/2006 4:21:30 AM
Hi again and thanks for the reply

I have made a stripped-down application that runs on the same server
machine and client machines and that only does one thing: checking
every second that the clients are running. I'm doing this exactly the
same way as in my first application, but in this small application
there are no delays. Even if I run it simultaneously with the first
application, and the first application has a delay, there is no delay
in the small application. My conclusion is therefore that there must be
some problem with the client. Something seems to block the client for
remote calls at certain times, and I don't have a clue to what it is.
If anyone has an idea, please drop a line...

/Oskar

Goran Sliskovic skrev:
[quoted text, click to view]
Re: Problem with delay Spam Catcher
8/24/2006 10:08:45 PM
oskar@musiker.nu wrote in news:1156418490.882230.208850
@m79g2000cwm.googlegroups.com:

[quoted text, click to view]

Are you doing any .invoke to the GUI?

..invoke locks up remoting, rather use .begininvoke to marshal remoting
calls to the GUI.

We've never had any issues with remoting in terms of response time... could
it be a code issue? How are you talking to multiple clients? Is this a
Re: Problem with delay oskar NO[at]SPAM musiker.nu
9/4/2006 6:38:25 AM
[quoted text, click to view]

I only use .BeginInvoke.

[quoted text, click to view]

I'll try to explain shortly how my application (called X) works. It
consists of three projects: Xcommon (a class library), Xstation (the
client app) and Xserver (the server app). Xcommon contains the classes
XStationService and XServerService and also interfaces IStation and
IServer. The XStationService has one associated IStation instance and
the XServerService has an associated IServer instance.

Xstation contains the class MainForm, which is the startup class.
MainForm creates an object of the Client class that implements
IStation. The Client class in its turn creates an XStationService
instance that is the remoting object. All calls from the server are
propagated from the XStationService object to the Client object and to
the MainForm object, where I use .BeginInvoke to do the actual action.

Xserver contains the class Main, which is its startup class. Main
creates a Server object (that implements IServer). The Server creates
an XServerService object for remoting and also starts a thread, the
XEngine. When a client (XStationService) registers to the Xserver it is
wrapped in another object and added to the stations Collection of the
Xserver. When calls are made to all stations this Collection is
iterated over and each station is called.

The delay appears when the XEngine thread calls the
Xserver.RemoveDeadStations method, that iterates over the stations
Collection and calls XStationService.CheckIfAlive for each
station/client. The call for CheckIfAlive is encapsuled in a try-catch
block, and if an exception is thrown it is assumed that the
station/client no longer is contactable (the network connection may be
down or something).

Well, that wasn't short, but I hope it is understandable, and I'm still
very grateful for any response...
AddThis Social Bookmark Button