星期四, 一月 10, 2008

Java email if internet detected v2.0

Hi buddies,
In some extreme testing environment, it has been proven that the function InetAddress.isReachable() does not send out the ICMP ping request if the administration privilege is not satisfied.

So, as an enhancement against on this issue, I have refactor'ed the class ip_getter function isOnInternet to be isOnInternetByJava, along with adding a new function isOnInternetByWindows.

isOnInternetByJava is implementing the ping functionality by the JDK function isReachable, however, isOnInternetByWindows achieves this goal by explicitly sending ICMP ping request to the specific host address, using a user defined DLL: pingicmp.dll.

Besides this change on ping functionality implementing level, all other parts stays the same.
When deploying the program, please remember to copy the pingicmp.dll to %JAVA_HOME%/bin. After that, directly run the program j_mail_on_net_fat_2.0.jar will be just fine.


The source code can be downloaded here.
The executable jar and dll can be downloaded here.

Thanks to author of pingicmp.

没有评论: