Programming Assignment Help

For debugging and troubleshooting applications using .NET, remoting tracking services can be used. The System. Runtime. Remoting. Services. TrackingService class provides a trackmg’service to get information about when marshaling and unmarshaling occur, when remote objects are called and disconnected, and so on:

With the TrackingServices utility class we can register and unregister a handler that implements ITrackingHand!!.er.

The ITrackingHandler interface is called when an event happens on a remote object, or a proxy. We can implement three methods in the handler: !1arshaledObject (), unmarshaledObj ect ( ), and DisconnectedObj ect ( );

To see tracking services in action in both the client and the server, we create a new class library, TrackingHar:dler. The TrackingHandler class implements the Tracking Handler interface. In the methods we receive two arguments: the object itself and an ObjRef. With the ObjRef we can get information about the URI, the channel, and the envoy sinks. We can also attach new sinks to add a contributor to all the called methods. In our example we’re writing the URI and information about the channel to the console:

Tracking Services

‘When starting the server, a first instance is created during registration of the well-known type and we get the following output. Marshalec Object () gets called and displays the type of the object to ‘marshal – lrlrox. ProCSharp. Remoting. Hello With the object DR! we see a GUlD that’s used internally in the remoting runtime to distinguish different instances- and the DRI we specified. With the channel URI the configuration of the channel can be verified. In this case the host name is CNagel: