//---------- main /** * Runs the discoverer and shows a message dialog with the returned report. * @param args args[0] - stun server address, args[1] - port. in the case of * no args - defaults are provided. * @throws java.lang.Exception if an exception occurrs during the discovery * process. */ #if false public static void main(String[] args) { StunAddress localAddr = null; StunAddress serverAddr = null; if (args.Length == 4) { localAddr = new StunAddress(args[2], Integer.valueOf(args[3]).intValue()); serverAddr = new StunAddress(args[0], Integer.valueOf(args[1]).intValue()); } else { localAddr = new StunAddress(InetAddress.getLocalHost(), 5678); serverAddr = new StunAddress("stun01bak.sipphone.com.", 3479); } NetworkConfigurationDiscoveryProcess addressDiscovery = new NetworkConfigurationDiscoveryProcess(localAddr, serverAddr); addressDiscovery.start(); StunDiscoveryReport report = addressDiscovery.determineAddress(); System.oout.println(report); // javax.swing.JOptionPane.showMessageDialog( // null, // report.toString(), // "Stun Discovery Process", // javax.swing.JOptionPane.INFORMATION_MESSAGE); System.exit(0); }
//---------- main /** * Runs the discoverer and shows a message dialog with the returned report. * @param args args[0] - stun server address, args[1] - port. in the case of * no args - defaults are provided. * @throws java.lang.Exception if an exception occurrs during the discovery * process. */ public static void main(String[] args) { StunAddress localAddr = null; StunAddress serverAddr = null; if(args.Length == 4) { localAddr = new StunAddress(args[2], Integer.valueOf(args[3]).intValue()); serverAddr = new StunAddress(args[0], Integer.valueOf(args[1]).intValue()); } else { localAddr = new StunAddress(InetAddress.getLocalHost(), 5678); serverAddr = new StunAddress("stun01bak.sipphone.com.", 3479); } NetworkConfigurationDiscoveryProcess addressDiscovery = new NetworkConfigurationDiscoveryProcess(localAddr, serverAddr); addressDiscovery.start(); StunDiscoveryReport report = addressDiscovery.determineAddress(); System.oout.println(report); // javax.swing.JOptionPane.showMessageDialog( // null, // report.toString(), // "Stun Discovery Process", // javax.swing.JOptionPane.INFORMATION_MESSAGE); System.exit(0); }