Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Tue, 5 Feb 2008 02:36:00 -0800,    group: microsoft.public.dotnet.distributed_apps        back       


System.Delegate.Remove fialed on remote delegates   
Hi,

I have remote delegates, but when the remote client is not avialable anymore 
(crashed for example), I can't remove the delegate from the inivocation list 
on the server side.
When I call System.Delegate.Remove I got the error message:

System.Net.WebException: Unable to connect to the remote server ---> 
System.Net.Sockets.SocketException: A connection attempt failed because the 
con
nected party did not properly respond after a period of time, or established 
connection failed because connected host ha
s failed to respond 192.168.0.223:4674
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, 
SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, 
Socket s4, Socket s6, Socket& socket, IPAddr
ess& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 
timeout, Exception& exception)
   --- End of inner exception stack trace ---

How can I remove a remote delegate if the remote object doesn't exists 
anymore?

Thanks
Bart
date: Tue, 5 Feb 2008 02:36:00 -0800   author:   Bart am

RE: System.Delegate.Remove fialed on remote delegates   
Hi Bart,

Based on my understanding, System.Delegate.Remove will not raise the 
exception; invoking a method on a dead client will. In which case you 
should catch the exception and calls System.Delegate.Remove on it.

I hope I haven't misunderstood anything.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
date: Wed, 06 Feb 2008 02:45:39 GMT   author:   (Walter Wang [MSFT])

RE: System.Delegate.Remove fialed on remote delegates   
You are right.
I was throwing the original exception again.
Now the System.Delegate.Remove does not throw any exeption but the delegate 
is not removed.

What could be wrong?

This is my code:
       public static void UpdateRemoteClient(object sp )

        {
            SubParameters par = (SubParameters)sp;
            try
            {
                par.subm.Invoke(null, par.e);
            }
            catch (Exception ex)
            {
                try
                {
                    //par.Submission -= new SubmissionEventHandler(par.subm); 
                    System.Delegate.Remove(par.Submission, par.subm);
                }
                catch (Exception ex1)
                {
                    log.Error( ex1);
                }
            }
        }

""Walter Wang [MSFT]"" wrote:

> Hi Bart,
> 
> Based on my understanding, System.Delegate.Remove will not raise the 
> exception; invoking a method on a dead client will. In which case you 
> should catch the exception and calls System.Delegate.Remove on it.
> 
> I hope I haven't misunderstood anything.
> 
> 
> Regards,
> Walter Wang (wawang@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
> 
> This posting is provided "AS IS" with no warranties, and confers no rights. 
> 
>
date: Tue, 19 Feb 2008 05:31:00 -0800   author:   Bart am

RE: System.Delegate.Remove fialed on remote delegates   
Hi Bart,

If you check the documentation of System.Delegate.Remove, you will find 
that it returns a new delegate with an invocation list formed by taking the 
invocation list of sourceand removing the last occurrence of the invocation 
list of value.

Therefore you need to set its return value to the first parameter:

par.Submission = System.Delegate.Remove(par.Submission, par.subm);


Hope this helps.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
date: Wed, 20 Feb 2008 07:34:09 GMT   author:   (Walter Wang [MSFT])

RE: System.Delegate.Remove fialed on remote delegates   
Hello Bart,

Would you mind letting me know the result of the suggestions from Walter? 
If you need further assistance, feel free to let me know. 

Have a great day!

Regards, 
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue. 
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Thu, 28 Feb 2008 04:06:34 GMT   author:   (Jialiang Ge [MSFT])

RE: System.Delegate.Remove fialed on remote delegates   
Hi Jialiang,

Yes, indeed, thanks

Bart

"Jialiang Ge [MSFT]" wrote:

> Hello Bart,
> 
> Would you mind letting me know the result of the suggestions from Walter? 
> If you need further assistance, feel free to let me know. 
> 
> Have a great day!
> 
> Regards, 
> Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> =================================================
> When responding to posts, please "Reply to Group" via your newsreader
> so that others may learn and benefit from your issue. 
> =================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
> 
>
date: Thu, 28 Feb 2008 01:46:00 -0800   author:   Bart am

RE: System.Delegate.Remove fialed on remote delegates   
Hi Jialiang,

I cannot find the the name or ip address of the client in the remote objects.
Do you know where I can find in the objects returned by the 
getinvocationlist where I can find the client identification?

Thanks
Bart

"Jialiang Ge [MSFT]" wrote:

> Hello Bart,
> 
> Would you mind letting me know the result of the suggestions from Walter? 
> If you need further assistance, feel free to let me know. 
> 
> Have a great day!
> 
> Regards, 
> Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> =================================================
> When responding to posts, please "Reply to Group" via your newsreader
> so that others may learn and benefit from your issue. 
> =================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
> 
>
date: Fri, 7 Mar 2008 03:22:00 -0800   author:   Bart am

RE: System.Delegate.Remove fialed on remote delegates   
Hello Brat,

I find this entry of maillist online: "Retrieving IP Address using Remoting"
http://www.mail-archive.com/advanced-dotnet@discuss.develop.com/msg05704.htm
l
In the post, it returns the clients information of the Delegate collection 
returned by GetInvocationList().
Please have a try and let me know if it works for your question.

Regards, 
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Mon, 10 Mar 2008 04:33:04 GMT   author:   (Jialiang Ge [MSFT])

RE: System.Delegate.Remove fialed on remote delegates   
Hello Bart,

Since I haven't seen your reply after I last posted mine, I am writing to 
check the status of this post. Would you mind letting me know the result of 
the suggestions? Please feel free to let me know if there's anything else I 
can help. Thanks.

Best regards,
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Fri, 14 Mar 2008 05:58:08 GMT   author:   (Jialiang Ge [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us