Static methods can not be called remotely

Source: Internet
Author: User

Static methods can not be called remotely

 


The client application can not access to static methods/properties/fields remotely. since you access a static method using classname. staticmethod, instead of objref. staticmethod, there's no proxy involved. so access to static methods always takes place in the client's context.

 

But you can add a thin non-static wrapper around und each static method in order to remote calling.

 

Take the following code snippet as an example:

Public class myclass: marshalbyrefobject

 {

Public static void dosomething (...) // can not be called remotely

{

...

}

 

Public void dosomethingwrapper (...) // can be called remotely

{

Dosomething (...);

}

 }

 

Refer to the articles as follows to get more information:

1. in-depth exploration of the. NET remoting infrastructure,
Http://www.cnblogs.com/rickie/archive/2004/10/22/55292.html
2. Several Problems with remotingsqlhelper,
Http://www.cnblogs.com/rickie/archive/2004/10/13/51500.html

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.