[Zerofile-svn] SF.net SVN: zerofile: [11] trunk/src
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
|
From: <kar...@us...> - 2007-11-03 18:59:25
|
Revision: 11
http://zerofile.svn.sourceforge.net/zerofile/?rev=11&view=rev
Author: karl-bengtsson
Date: 2007-11-03 11:59:30 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
Moved test registration into the main ZeroFile.java file so that we only have one main() in all of our classes. The registration with Zeroconf should eventually be handled by some sort of special registration class.
Modified Paths:
--------------
trunk/src/ZeroConfRegistrationTest.java
trunk/src/ZeroFile.java
Modified: trunk/src/ZeroConfRegistrationTest.java
===================================================================
--- trunk/src/ZeroConfRegistrationTest.java 2007-11-03 13:21:05 UTC (rev 10)
+++ trunk/src/ZeroConfRegistrationTest.java 2007-11-03 18:59:30 UTC (rev 11)
@@ -1,5 +1,4 @@
import com.apple.dnssd.*;
-import java.net.*;
/*
* This class tests XMPP ZeroConf registration, by registering as
@@ -62,28 +61,4 @@
System.out.println("Registration Stopping");
r.stop( );
}
-
- public static void main(String[] args) {
- if (args.length > 1)
- {
- System.out.println("Usage: java TestRegister name");
- System.exit(-1);
- }
- else
- {
- 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);
- new ZeroConfRegistrationTest(name, s.getLocalPort( ));
- }
- catch(Exception e)
- {
- e.printStackTrace( );
- System.exit(-1);
- }
- }
- }
}
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-03 13:21:05 UTC (rev 10)
+++ trunk/src/ZeroFile.java 2007-11-03 18:59:30 UTC (rev 11)
@@ -1,3 +1,5 @@
+import java.net.ServerSocket;
+
// Main loop of the program
public class ZeroFile {
@@ -8,5 +10,26 @@
public static void main(String[] args) {
ZeroFileMainWindow Huvudfonster = new ZeroFileMainWindow();
Huvudfonster.setVisible(true);
+ if (args.length > 1)
+ {
+ System.out.println("Usage: java TestRegister name");
+ System.exit(-1);
+ }
+ else
+ {
+ 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);
+ new ZeroConfRegistrationTest(name, s.getLocalPort( ));
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace( );
+ System.exit(-1);
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|