473,670 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What about Destructor for Remoting cleaning?

As been said in the discussion ‘Why not destructor
’http://msdn.microsoft.com/newsgroups...5-ec35b567dd31

It is, with no doubt, bad to write destructors.

Nevertheless, destructors are needed whenever unmanaged code need to be
handled or freed.

My class is using a Remoting object, does any of this following lines need
to be invoked in the destructor or at the dispose, or maybe I can ignore them
completely assuming the GC will clean them up when it will clean by object.

* RemotingService s.Disconnect(.. .);
* ChannelServices .UnregisterChan nel(...);
* Or any other remoting cleaning that you think is needed.

--
Regards
Sharon G.
Nov 16 '05 #1
1 1806
"Sharon" <Sh****@discuss ions.microsoft. com> wrote in message
news:42******** *************** ***********@mic rosoft.com...
As been said in the discussion 'Why not destructor?
'http://msdn.microsoft. com/newsgroups/managed/default.aspx?dg =microsoft.publ ic.dotnet.langu ages.csharp&mid =203132f5-041f-47c8-8c55-ec35b567dd31 My class is using a Remoting object, does any of this following lines need
to be invoked in the destructor or at the dispose, or maybe I can ignore
them
completely assuming the GC will clean them up when it will clean by
object.

* RemotingService s.Disconnect(.. .);
This is called by the server-side remoting process if it has used
RemotingService s.Marshal to hook an object to the end of the server remoting
pipeline. It disconnects this object from the remoting pipeline.
* ChannelServices .UnregisterChan nel(...);
The server process (and client process if you are using callbacks) have to
register a channel. You only call this if the process no longer wants to
listen on that channel. If the process is shutting down it will sooon stop
listening on that channel anyway.
* Or any other remoting cleaning that you think is needed.


Remoting is all managed code (as far as the bits that we can touch anyway)
and as such will take care of its own clean up. Also AFAIK nothing in the
remoting infrastructure implements IDisposable so nothing advertises that it
*needs* clean up.

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1785
by: Tom | last post by:
hi, I'm trying to write a multi client chat app using remoting. however atm, I'm stuck when a userA tries to send userB a msg... say there're userA, userB and userC. on the server side how do I know which user is userB when I recieve message from userB ? what should the process be. I know I need to store a reference of the clients somehow on the server. but how can this be done ?
15
5744
by: Sharon | last post by:
I’m trying to build a generic Publisher-Subscriber that will work over the net, so I’m using the Remoting. I wish that the subscriber user will be notify about the messages sent by the remote publisher, so I used delegate that the user will be able to set on it his own function for that purpuse. The trouble is that this delegate must not be static because there may be many subscribers, and each subscriber may have different...
13
5440
by: Kyle Adams | last post by:
I don't know where is the right place to ask this so I will start here. Can someone explain to me what these represent? I think they all have to do with the middleware level, but I really don't understand what a DCOM Server is or a Microsoft Transaction Server, etc. I have no idea.... Kyle
8
1748
by: Raju Joseph | last post by:
Hi All, I am just trying to get an opinion here. I know this is always a tough choice to make. We are in the process of converting our VB6 based Healthcare Information System (a full-fledged package) to .NET. Our clients have been asking for lot of new stuff namely being able to send patient information to devices, being able to fix appointments online, etc.
35
3307
by: Peter Oliphant | last post by:
I'm programming in VS C++.NET 2005 using cli:/pure syntax. In my code I have a class derived from Form that creates an instance of one of my custom classes via gcnew and stores the pointer in a member. However, I set a breakpoint at the destructor of this instance's class and it was never called!!! I can see how it might not get called at a deterministic time. But NEVER? So, I guess I need to know the rules about destructors. I would...
3
2459
by: RitualDave | last post by:
This compiles and runs successfully in VS2005: ref class A { private: ~A() { this->!A(); } // private! !A() { } // private! }; ....
2
1401
by: Robert | last post by:
I'm reading the book "Programming .NET Components" by Juval Lowy, a renowned ..NET expert as recognized by MSFT. In the book he provides a base class example that implements a pattern for safely cleaning up your objects (handling "IDisposable", etc.). His class calls a (do-nothing) virtual "Cleanup()" function from its destructor however (we're supposed to override it) and I'd like to confirm that this is in fact safe. Presumably it is but...
0
3399
by: Kristian Reukauff | last post by:
Hi I have a problem with the .Net-Securty-Functions. I've got a client and a server. When I try to register a channel at the server with this line: ChannelServices.RegisterChannel(chan, false); I get the following error - doesn't matter if I try it local from my machine or from a remote machine. (After the Errormessage is more text ;))
0
1196
by: Now You Know | last post by:
Carpet Cleaners Los Angeles Home Carpet Rug Upholstery Cleaning Phone 1 310 925 1720 OR 1-818-386-1022 Local Call California Wide We offer carpet cleaning services such as; Steam Cleaning, Dry Cleaning, Fabric Lounge Suite Cleaning, Leather Lounge Suite Cleaning, Tile & Grout Cleaning, Mattress Cleaning, Wet Carpet / Water Damage Restoration for: offices, homes, restaurants, clubs and hotels http://carpetcleanersorangecounty.blogspot.com/...
0
8388
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8663
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1799
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.