ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 6th, 2003, 05:23 AM
mra mra is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Russia, Tomsk
Posts: 2 mra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question .NET Marshalling problem

Hi!

My Server application shares some objects (defined in shared library) with Web Service to pass data to and retrieve from Client. But from time to time shared object gets disconnected for unknown reason.. Below I've put code and error details. Can somebody explain why the problems occurs?..

Thanks in advance!


Server application has following code:
IPObject = new InterProcObject();
TcpServerChannel channel = new TcpServerChannel(9932);
ChannelServices.RegisterChannel(channel);
RemotingServices.SetObjectUriForMarshal(IPObject, "IPObject");
RemotingServices.Marshal(IPObject);

Web Service code:
[WebMethod]
public string[] GetProducts()
{
try
{
IPObject = (InterProcObject)Activator.GetObject(
typeof(InterProcObject), "tcp://localhost:9932/IPObject");
InterProcData IOdata = IPObject.IPData;
return IPObject.IPData.sProducts;
}
catch (Exception expt)
{
FileStream fs = new FileStream( "c:\\BN3.log", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter w = new StreamWriter(fs);
fs.Seek(0,SeekOrigin.End);
w.WriteLine(expt.InnerException);
w.WriteLine(expt.Message);
w.WriteLine(expt.Source);
w.WriteLine(expt.StackTrace);
w.Close();
fs.Close();
string[] res = null;
return res;
}
}

.NET writes to log file:
Object </IPObject> has been disconnected or does not exist at the server.
mscorlib

Server stack trace:
at System.Runtime.Remoting.Channels.ChannelServices.C heckDisconnectedOrCreateWellKnownObject(IMessage msg)
at System.Runtime.Remoting.Channels.ChannelServices.D ispatchMessage(IServerChannelSinkStack sinkStack, IMessage msg, IMessage& replyMsg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at System.Object.FieldGetter(String typeName, String fieldName, Object& val)
at BN3WebService.Service1.GetProducts()

Reply With Quote
  #2  
Old February 13th, 2003, 09:56 PM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 17
Send a message via ICQ to James Yang
i didn't go thru the code but, these would be my guesses regarding your disconnecting problem.

maybe your server is too busy dealing with existing objects, unless you set it as singleton.

and if its physically separated, then it might be the medium such as NIC cable etc.

I do think that if it is disconnecting then its either because of the server load or the medium and in rarecases it could be a bug in the remoting framework.
__________________
Regards,

James Yang
.NET Developer / Network Engineer
MCSE, MCDBA, MCSA, CCNA

http://www.yellowpin.com/
http://www.opentechsupport.com/

Reply With Quote
  #3  
Old February 13th, 2003, 11:25 PM
mra mra is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Russia, Tomsk
Posts: 2 mra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I've already solved the problem - it was caused by default life time of object - 5 minutes. To make object's life infinite I've overrode InitializeLifetimeService (to return null all the time) in my class derived from System.MarshalByRefObject.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > .NET Marshalling problem


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap