Hprose Use Experience

Source: Internet
Author: User

The use experience of Hprose

I am a student of Qingdao Binhai College, this year has the opportunity to participate in the Qilu software competition. Our competition topic is Taobao online-distributed resource retrieval system.

When you get this system, the first thing I think of is websevices, in this time I understand some of the websevices use methods and characteristics. But I learned that when websevices transmits large volumes of data, its speed becomes very slow. Just when I was troubled by the problem. Hprose into my field of vision.

First of all know Hprose is through the webcast of Microsoft, inside clothing Mr. Strong focus on the introduction of the hprose of this distributed framework of performance and use methods. This makes me seem to see a perfect solution for an efficient distributed framework. But at the same time, Mr. Clothing has mentioned that this middleware is open source business. This time we are worried about whether this framework is too expensive so that our students can not afford.

As a then, we with disturbed mood, dialed Weifang lofty speed Qualcomm Software Co., Ltd. telephone. They gave us a warm reply. The next day they passed the QQ mailbox to send us the Hprose Student Edition. And it's free.

At first we could hardly believe it, but Hprose's head said Mr. Ma Bingyao was supportive of the new technology for students. It's very touching, really. Our teacher said to us that the more skilled Daniel is, the more humble and willing to give. Mr. Ma Bingyao's noble character really makes me admire it.

OK, I'll explain how to use hprose, the language we use is C #. Below I will explain the use of hprose in C # Tutorial.

First for Hprose it has two DLL files, of course one is on the server side and one is on the client. The server-side file name is System.Numerics.dll and the client's file name is Hprose.Client.DLL. There is no difference between how they are used and how they are used in general DLLs. is to refer to it first and then introduce the namespace.

Here's a hprose server-side approach that we've released.

So other programs can use this method like WebServices.

Then we can use this method conveniently through the client. Then the client we first introduce the client's DLL file and then introduce the namespace. This allows you to use its client programs.

Because what we do is distributed, so at first we intend to use multithreading so that each host can use resources well. But we do not fine, for the documentation of the taste is not good, so the general for loop method.

for (int i = 0; i < reader.tables[0]. Rows.Count; i++)

{

if (reader.tables[0). Rows[i][0]. ToString ()!= gethostip.gethostip ())

{

Ip[i] = "http://" + reader.tables[0]. Rows[i][0]. ToString () + ": 8080/hprose/helloservice.aspx";

Hprosehttpclient client = new Hprosehttpclient (Ip[i]);

Try

{

List<tdates> news = client. Invoke<list<tdates>> ("Ex2_seacher", new object[] {text, "All Resources", fenlei});

Newslist = Newslist.concat (News). Tolist<tdates> ();

}

catch (Exception e)

{

Continue

}

}

Else

Continue

}

We do this in such a way as to search each machine. Of course, the results of the search to my surprise, in the case of four hosts at the same time online, it took only 43 milliseconds, this is a very exciting number.

Image upload inconvenient, so please forgive me


Thank you

2011.11.9

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.