点点滴滴

导航

 

To resolve addTarget delay problem do this trick for the first target:
String ipadr = [target ip address];
int port=[target port];
InetAddress adr = InetAddress.getByName(ipadr);
byte[] badr = adr.getAddress();
InetAddress nadr = InetAddress.getByAddress( InetAddress.getLocalHost().getHostName(), badr );
[Or even simpler: InetAddress nadr = InetAddress.getByAddress( �localhost�, badr );]
Now addTarget (new SessionAddress(nadr, port)) takes no time at all.
Again it's enough to do this only for the first target.

posted on 2011-08-26 11:17  attar  阅读(5069)  评论(0)    收藏  举报