Skip to content

Two optimization suggestions are about obtaining local ip addresses #44

@yangsen-cn

Description

@yangsen-cn

1、 In org.cybergarage.net.HostInterface getNHostAddresses and getHostAddress(int n) ,the two methods, should the following code be added to block invalid ips?

NetworkInterface ni = (NetworkInterface) nis.nextElement();
if(!ni.isUp() || ni.isLoopback() || ni.isVirtual())
{
continue;
}

2、 getNHostAddresses should the obtained ip address be cached ? for use in the methods ( getHostAddress(int n) )

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions