Problem with remoting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all!

I am out of ideas. I have a client\server application that for the most
part works just great. An overview of the architecture is:

+--------------------------+
| Server: windows service |
+------------+-------------+
|
TCP
|
==============================
Machine Boundry
==============================
|
+---------------+-----------------+
| Client Service: windows service |
+---------------+-----------------+
|
Named Pipes
|
==============================
Process Boundry
==============================
|
+---------------------------------+
| Client App: Win32 app |
+---------------------------------+

All of the cross-(process|machine) remoting is done through .Net remoting.
There is an object factory on the client service and on the server. The
Client applications connect to the factory on the client service which
requests the object from the factory on the server.

When the client first starts up, everything works as expected, no problems.
If I stop and start the Server service, the next time the Client App requests
an object (MarshalByRef) from the factory on the Server through the factory
at the client service, the call executes OK. There is a valid Transparent
Proxy returned, but throws an exception when ever a method or property is
invoked on the remote object via the transparent proxy. The exception is the
Remote server encountered an internal error.

I am totally confused about what is wrong. Any suggestions?
 
Hello all!

I am out of ideas. I have a client\server application that for the most
part works just great. An overview of the architecture is:

+--------------------------+
| Server: windows service |
+------------+-------------+
|
TCP
|
==============================
Machine Boundry
==============================
|
+---------------+-----------------+
| Client Service: windows service |
+---------------+-----------------+
|
Named Pipes
|
==============================
Process Boundry
==============================
|
+---------------------------------+
| Client App: Win32 app |
+---------------------------------+

All of the cross-(process|machine) remoting is done through .Net remoting.
There is an object factory on the client service and on the server. The
Client applications connect to the factory on the client service which
requests the object from the factory on the server.

When the client first starts up, everything works as expected, no problems.
If I stop and start the Server service, the next time the Client App requests
an object (MarshalByRef) from the factory on the Server through the factory
at the client service, the call executes OK. There is a valid Transparent
Proxy returned, but throws an exception when ever a method or property is
invoked on the remote object via the transparent proxy. The exception is the
Remote server encountered an internal error.

I am totally confused about what is wrong. Any suggestions?

I guess that you have proper logging, so you know that the client
service connects indeed to the server after the restart and indeed get's
a new object. And you know that the end client gets exactly that object,
right?

Then, I would try to switch to XML formatter (I guess you use binary),
and use a tool like Ethreal to monitor the traffic.

Sunny
 
Thanks for the rapid response.

Sunny said:
I guess that you have proper logging, so you know that the client
service connects indeed to the server after the restart and indeed get's
a new object. And you know that the end client gets exactly that object,
right?

- Yes. I have stepped through it on the server and it is returning the
correct object. When stepping through it on the client I see the transparent
proxy and through some exploring in the watch window, I can see that it is
refrencing the correct server via the URL somewhere in the object refrence.
Then, I would try to switch to XML formatter (I guess you use binary),
and use a tool like Ethreal to monitor the traffic.

That sounds like a good idea. What exactly should I be looking for?
 
Thanks for the rapid response.



- Yes. I have stepped through it on the server and it is returning the
correct object. When stepping through it on the client I see the transparent
proxy and through some exploring in the watch window, I can see that it is
refrencing the correct server via the URL somewhere in the object refrence.

Are the objrefs the same (I.e. the uris) ?
That sounds like a good idea. What exactly should I be looking for?

At least you will see the request send from the client to the server.
And maybe the response (if any). Also, note that using the debugger is
just for that - debugging. For normal tracking, it's better to use some
logging, so you can explore all the parties at the same time. Just write
in a file the uri's of every objref and compare. Make your server to
write in a file when it get hit, when a method (or property) starts, and
ends. That way you may track down where the problem happens, when the
arrives, or when the respond is send back, etc.

Does your server crash when the exception happens?

Sunny
 
Sunny said:
Does your server crash when the exception happens?

No. I am stoping the service manually. I am testing to make sure that the
system can recover from a server going down. What is strange is that if i
disconnect the client from the server, then reconnect the client to the
server it works fine. The only time there is a problem is if the client is
connecting to a different process on the same server (as a result of the
service restarting etc.)
 
No. I am stoping the service manually. I am testing to make sure that the
system can recover from a server going down. What is strange is that if i
disconnect the client from the server, then reconnect the client to the
server it works fine. The only time there is a problem is if the client is
connecting to a different process on the same server (as a result of the
service restarting etc.)

Can you post a short but compllete example?

http://www.yoda.arachsys.com/csharp/complete.html

Sunny
 
Back
Top