Problem:
- Product Name: VisiBroker Java
 - Product Version: 6.5 and above
 - Product Component:Notification Service
 - Platform/OS version: All
 
If a PDA/mobile is connected to a client PC prior to the PushedConsumer program execution, the Windows Active Sync 4.5 will opens up a new local network connection to synchronize the data with PDA which blocks/stalls the communication between PushedConsumer and VisiNotify.
The PushedConsumer VisiBroker ORB will read the client machine IP address using "localhost" and send it to VisiNotify for event notification. In this case, the IP address of the PDA will be used instead of the original machine IP. It cannot establish TCP connection with the VisiNotify because the PDA address is an internal address.
Resolution:
There are two ways to resolve this problem.
- If a client machine has a fixed IP or is assigned with the same IP address by the DHCP server. you can set the machine original IP address to the "vbroker.orb.localhost" property. The ORB will always use this value to communicate with VisiNotify event channel.
 - If your network cannot allocate a fixed IP to the client machine, you need to change the code in the PushConsumer application. Before you call the ORB.init(...) method, the PushConsumer need to get the correct IP address (e.g. by using the routine below) based on the machine host name.
 
  public static String getHostAddress(String theHostname) throws UnknownHostException{
    if (theHostname != null){
      InetAddress[] ipAddresses = InetAddress.getAllByName(theHostname);
      InetAddress theAddress ;
      for(InetAddress theAddr : ipAddresses){
        if (!theAddr.isLinkLocalAddress()){
          theAddress = theAddr;
          return theAddress.getHostAddress();
        }
      }
    }
    return null;
  }
You can invoke "System.setProperty("vbroker.orb.localhost", getHostAddress(<hostanme>));" to set the localhost property dynamically before calling ORB.init(...) method.
#VisiNotify
#VisiBroker
#notificationservice
#Java
#Security