Problems with network communication functions of orbacus

Source: Internet
Author: User

We often encounter the problem that the network link cannot be linked during the process of developing the CORBA product. Eliminate firewall interference and open the corresponding port (10003), and use the TCP/IP tool to test, the network condition is good. Because the process of CORBA middleware is complex, many developers encounter some difficult problems and lose confidence in exploring the root cause of the problem.

When a product development process is excellent, the complexity of the environment is limited to the ideal situation, and we will not deny it because of some problems. As Microsoft's operating systems are constantly being upgraded and optimized, many patch packages are often released, which fully demonstrates that there are still some problems.


If you use orbacus for product development, the following problems may occur.

1. Solve the problem between the Working Group and the domain name

When the Working Group implements corab middleware with the domain computer, it may be unable to communicate with the middleware.

Modify the hosts file in the c: \ windows \ system32 \ drivers \ etc folder of the working Group Computer (pay attention to different Windows operating system files:

...

...


192.168.1.200 PC-2 # Add domain name and IP address ing

2. Solve the Problem of binding multiple Nic addresses

When the PC-1 runs the CORBA program, profile_host In the IIOP protocol of the orbacus product is preferentially bound to the first NIC address 10.7.126.7. 10.7.126.7 is an external network card. It should be 10.110.42.3. This is a problem with the orbacus product. The following changes are made:

1) orbacus4.1.2 product modification:

A. orbinit. cpp: 861 rows. Add the following statement:

Else if (strcmp (key, "OOC. Orb. canonical. localhost") = 0)


{


// Ignore -- handled in getcanonicalhostname


}

B. net. cpp function char * ob: getcanonicalhostname (bool numeric): number of rows: 415,

Add the following statement:

OB::Properties_var properties = OB::Properties::getDefaultProperties();const char *canonicalhost = properties -> getProperty("ooc.orb.canonical.localhost");if (canonicalhost){    int i = 0;    while (ent->h_addr_list[i] != NULL)    {        struct in_addr in;        in.s_addr = *((u_long *)(&ent->h_addr_list[i][0]));        char *localhost = string_dup(inet_ntoa(in));        if (strcmp(localhost, canonicalhost) == 0)        {            host = string_dup(localhost);            break;        }        i++;    }}

C. When this happens, you need to add statement filtering in orbacus. cfg:


# Prevent the first network specified by default from being invalid when the host has multiple NICs.

OOC. Orb. canonical. localhost = 10.110.42.3

2) orbacus4.3.4 product modification:

A. orbinit. cpp: 946 rows. Add the following statement:

Else if (strcmp (key, "OOC. Orb. canonical. localhost") = 0)


{


// Ignore -- handled in gethoststring


}

B. net. cpp function char *

Ob: gethoststring (bool numeric, bool preferipv6)

Throw (CORBA: comm_failure, CORBA: no_memory)

Number of rows: 1515, add the following statement

OB::Properties_var properties = OB::Properties::getDefaultProperties();const char *canonicalhost = properties -> getProperty("ooc.orb.canonical.localhost");if (canonicalhost){    for (;;)    {        char *localhost = GetIPString((*it) -> ai_addr, (*it) -> ai_addrlen);        if (strcmp(localhost, canonicalhost) == 0)        {            host = CORBA::string_dup(localhost);            break;        }        if (*(++it) == 0)        {            break;        }    }}

C. When this happens, you need to add statement filtering in orbacus. cfg:


# Prevent the first network specified by default from being invalid when the host has multiple NICs.

OOC. Orb. canonical. localhost = 10.110.42.3

3. Conclusion

The above situations are some network problems found during orbacus debugging. I hope this article will help you in the development of the corresponding products.

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.