Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remoting: Server error when client closes!

Status
Not open for further replies.

DickyDoo

Technical User
Apr 16, 2003
3
GB
Hi

I'm writing an application using .net remoting, when the client is closed I get an error saing unhandled exception object reference no set to an instance of an object on the server side.

The dissasembly show the address of the error in System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback

The server offers two SAO singlecall object and one singleton. There is also a CAO. This is done without config files as follows:

HttpChannel chan = new HttpChannel(8888);
ChannelServices.RegisterChannel(chan);

WellKnownServiceTypeEntry remoteLineChartObject = new
WellKnownServiceTypeEntry(typeof(RemoteLineChartObject),
"RemoteLineChartObject.soap",
WellKnownObjectMode.SingleCall); RemotingConfiguration.RegisterWellKnownServiceType
(remoteLineChartObject);

WellKnownServiceTypeEntry remoteBarChartObject = new
WellKnownServiceTypeEntry(typeof(RemoteBarChartObject),
"RemoteBarChartObject.soap",
WellKnownObjectMode.SingleCall);
RemotingConfiguration.RegisterWellKnownServiceType
(remoteBarChartObject);

WellKnownServiceTypeEntry Authorisation = new
WellKnownServiceTypeEntry(typeof(Authorisation),
"Authorisation.soap",
WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType
(Authorisation);

Authorisation athorise = new Authorisation();
RemotingConfiguration.ApplicationName =
"RemotingChartService.StockChartServer";
RemotingConfiguration.RegisterActivatedServiceType(typeof
(RemotingChartService.SessionKeyManager.ServerKeyExchange));

Then on the client: - using

HttpChannel chan = new HttpChannel(0);
ChannelServices.RegisterChannel(chan);

MarshalByRefObject barObj =(MarshalByRefObject)
RemotingServices.Connect(typeof(BarChartInterface),
"
MarshalByRefObject lineObj = (MarshalByRefObject)
RemotingServices.Connect(typeof(LineChartInterface),
"
MarshalByRefObject authObj = (MarshalByRefObject)
RemotingServices.Connect(typeof
(RemotingChartService.SecurityInterfaces.IAuthorisation),
"

RemotingConfiguration.RegisterActivatedClientType(typeof
(RemotingChartService.SessionKeyManager.ServerKeyExchange),
"
Every time the client is closed, the server crashes. This is my first .net remoting application, infact its my first .net application. Could it be something to do with the lifetime of the CAO or the singleton, as this is not managed or is there a standard way of disconnecting from the seerver without causing server errors, any help with this would be appreciated.

Thankyou.

Richard H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top