Solved

Remoting: Disconnecting an object

Posted on 2004-04-07
4
398 Views
Last Modified: 2010-04-15
I have an object that receives events through remoting.  How can I "disconnect" this object so that the server cannot send any more events to it? (The same effect as closing my client application).
0
Comment
Question by:eternal_21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 10

Author Comment

by:eternal_21
ID: 10777152
I should mention that I am obtaining this object using,

  System.Runtime.Remoting.RemotingServices.Connect(System.Type, System.String).
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 10780982
I am not sure whether this can be applied to remoting, but generally disconnecting from event is done using -= operator. For example, if this code subscribes to some event:

        MouseEventsHandler handler;         // MouseEventsHandler is some delegate

        private void Form1_Load(object sender, System.EventArgs e)
        {
            ...
            // subscribe to m_MouseEvent event
            handler = new MouseEventsHandler(Form1_MouseEvent);   // keep this in class member if I want to unsubscribe later
            m_MessageFilter.m_MouseEvent += handler;
        }

To unsubscribe from this event I can use the following code:

        private void button1_Click(object sender, System.EventArgs e)
        {
            m_MessageFilter.m_MouseEvent -= handler;
        }
0
 
LVL 10

Author Comment

by:eternal_21
ID: 10781225
What I am looking for is a way to server the connection between the client and my server without having to unsubscribe to any events that my be in use... I will post some more code tomorrow - thanks for your advice Alex.
0
 
LVL 10

Author Comment

by:eternal_21
ID: 10852462
Sorry, AlexFM

This problem has been put on hold.  I will close this question for now, but select your answer as it may help others in the future.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question