Revision: 26
http://zerofile.svn.sourceforge.net/zerofile/?rev=26&view=rev
Author: karl-bengtsson
Date: 2007-11-06 06:12:44 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Updated the ZeroFile.java to skip any launch arguments
Modified Paths:
--------------
trunk/src/ZeroFile.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 14:03:07 UTC (rev 25)
+++ trunk/src/ZeroFile.java 2007-11-06 14:12:44 UTC (rev 26)
@@ -10,31 +10,21 @@
public static void main(String[] args) {
ZeroFileMainWindow.startMainWindow();
ZeroFileChatWindow.startChatWindow();
- if (args.length > 1)
+ try
{
- System.out.println("Usage: java TestRegister name");
- System.exit(-1);
+ // Let system allocate us an available port to listen on
+ ServerSocket s = new ServerSocket(0);
+ ZeroconfRegistration.registerService(s.getLocalPort());
+ Thread.sleep(5000);
+ ZeroconfRegistration.setStatus("dnd");
+ Thread.sleep(15000);
+ ZeroconfRegistration.unregisterService();
+ //new ZeroConfRegistrationTest(name, s.getLocalPort( ));
}
- else
+ catch(Exception e)
{
- try
- {
- //If name specified, use it, else use default name
- //String name = (args.length > 0) ? args[0] : null;
- // Let system allocate us an available port to listen on
- ServerSocket s = new ServerSocket(0);
- ZeroconfRegistration.registerService(s.getLocalPort());
- Thread.sleep(5000);
- ZeroconfRegistration.setStatus("dnd");
- Thread.sleep(15000);
- ZeroconfRegistration.unregisterService();
- //new ZeroConfRegistrationTest(name, s.getLocalPort( ));
- }
- catch(Exception e)
- {
- e.printStackTrace( );
- System.exit(-1);
- }
+ e.printStackTrace( );
+ System.exit(-1);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|