Download Latest Version shortpasta-icmp-1006.zip (2.3 MB)
Email in envelope

Get an email when there's a new version of Icmp Ping for Java by ShortPasta

Home / 1013
Name Modified Size InfoDownloads / Week
Parent folder
shortpasta-icmp2-1013.zip 2014-05-23 972.7 kB
readme.txt 2014-05-23 3.9 kB
Totals: 2 Items   976.5 kB 0
/**
 * ShortPasta Foundation
 * http://www.shortpasta.org
 * Copyright 2009 and beyond, Sal Ingrilli at the ShortPasta Software Foundation
 * <p/>
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation as long as:
 * 1. You credit the original author somewhere within your product or website
 * 2. The credit is easily reachable and not burried deep
 * 3. Your end-user can easily see it
 * 4. You register your name (optional) and company/group/org name (required)
 * at http://www.shortpasta.org
 * 5. You do all of the above within 4 weeks of integrating this software
 * 6. You contribute feedback, fixes, and requests for features
 * <p/>
 * If/when you derive a commercial gain from using this software
 * please donate at http://www.shortpasta.org
 * <p/>
 * If prefer or require, contact the author specified above to:
 * 1. Release you from the above requirements
 * 2. Acquire a commercial license
 * 3. Purchase a support contract
 * 4. Request a different license
 * 5. Anything else
 * <p/>
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, similarly
 * to how this is described in the GNU Lesser General Public License.
 * <p/>
 * User: Sal Ingrilli
 * Date: May 23, 2014
 * Time: 1:00:53 PM
 */
 
###
### Project details
###
Compilers
  Java code built with Sun Java 1.7.0_55-b13, but compiled for 1.6
  Apache Ant 1.9.2

Binaries
  jna-3.5.1.jar (677 KB)
  platform-3.5.1.jar (931 KB)
  shortpasta-icmp2.jar (25 KB)
  
Running from the command line
  1. Expand shortpasta-icmp2-1013.zip to c:\temp
  2. cmd
  3. cd C:\temp\shortpasta-icmp2\lib
  4. java -cp * org.shortpasta.icmp2.tool.Ping www.google.com
     -or, if the above does not work:
  4. java -cp jna-3.5.1.jar;platform-3.5.1.jar;shortpasta-icmp2.jar org.shortpasta.icmp2.tool.Ping www.google.com

Example:
  import org.shortpasta.icmp2.IcmpUtil;
  import org.shortpasta.icmp2.IcmpEchoRequest;
  import org.shortpasta.icmp2.IcmpEchoResponse;
  
  // initialize once, when the application boots up
  IcmpUtil.initialize ();
  
  // request - use IcmpUtil.createIcmpEchoRequest () to create a request with defaults
  final IcmpEchoRequest request = IcmpUtil.createIcmpEchoRequest ();
  request.setHost ("www.google.com");
  
  // delegate
  final IcmpEchoResponse response = IcmpUtil.executeEchoRequest (request);
  
  // log
  final String formattedResponse = IcmpUtil.formatResponse (response);
  System.out.println (formattedResponse);
  
  // cleanup once, when the application terminates
  IcmpUtil.destroy ();
  
###
### Date: 2014-04-23 13:00:00
### Build: 1013
###
-- [WARNING]
  In build 1013, shortpasta-icmp is now deprecated and replaced by shortpasta-icmp2
  shortpasta-icmp is a very small java wrapper around a small native implementation for win32 and uses JNI.
  shortpasta-icmp2 is a very small java wrapper around the native win32 methods and uses JNA to access them.
  So although shortpasta-icmp2 is only 25 KB, it requires 1,608 KB worth of jna jars to execute.
  If this is not acceptable to you, use build 1006.

-- [FEATURE]
  Add blocking call:
    IcmpEchoResponse org.shortpasta.icmp2.IcmpUtil.executeEchoRequest (IcmpEchoRequest).

  This implementation uses:
  1. JNA to invoke native methods
  2. winsock 2.0
  3. IcmpSendEcho instead of the raw socket () / bind () / send () family of methods
  
  Works on:
  Windows 8.1 64-bit 
  Windows Server 2008r2 64-bit 
  Windows 7 Pro 64-bit (ver 6.1.7601)
  Windows XP Pro 32-bit

-- Credits
  Kevin Shih
    Help with testing and integration
Source: readme.txt, updated 2014-05-23