view test/AutoSelectManager.java @ 420:5c95a9020e31

Modify ServerMainLoop
author one
date Fri, 13 Feb 2009 19:13:50 +0900
parents 784a4d67e6a5
children 7420dea70dd7
line wrap: on
line source

package test;

import java.io.IOException;

import rep.ServerMainLoop;
import rep.SessionManager;
import rep.handler.Editor;
import test.sematest.TestGUI;

public class AutoSelectManager extends SessionManager {

	public static void main(String[] args) throws InterruptedException, IOException {
		int port =ServerMainLoop.DEFAULT_PORT;
		int port_s = ServerMainLoop.DEFAULT_PORT;
		//System.setProperty("file.encoding", "UTF-8");
		if(args.length > 0){
			if (args.length!=2) {
				logger.writeLog("Usage: sessionManager our_port parent_port");
				return;
			}
			port = Integer.parseInt(args[0]);
			port_s = Integer.parseInt(args[1]);
		}
		Editor.noMergeMode = false;
		SessionManager sm = new SessionManager();
		sm.setReceivePort(port);
		sm.setParentPort(port_s);
		// Ok start main loop
		sm.init(port,new TestGUI(sm));
	}
}