All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jclarion.clarion.swing.gui.StartClient Maven / Gradle / Ivy

The newest version!
package org.jclarion.clarion.swing.gui;

import java.io.IOException;
import java.net.Socket;

public class StartClient {

	public static void main(String args[])
	{
		String host="localhost";
		if (args.length>0) host=args[0];
		int port = 5000;
		if (args.length>1) {
			String sport = args[1];
			if (sport!=null) {
				port=Integer.parseInt(sport);
			}
		}
		
		try {
			Socket t = new Socket(host,port);
			t.setTcpNoDelay(true);
			NetworkModel nm = new NetworkModel();
			nm.init(GUIModel.getClient(),new RemoteNetwork(Integer.MAX_VALUE/2),t.getInputStream(),t.getOutputStream());
			GUIModel.setServer(nm);
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy