FileDocCategorySizeDatePackage
PortOwner.javaAPI DocExample1879Sat Feb 26 22:45:34 GMT 2000None

PortOwner

public class PortOwner extends CommPortOpen
Demonstrate the port conflict resolution mechanism. Run two copies of this program and choose the same port in each. $Id: PortOwner.java,v 1.1 2000/02/27 03:45:34 ian Exp $

Fields Summary
String
myName
A name for showing which of several instances of this program
Constructors Summary
public PortOwner(String name)


		super(null);
		myName = name;
		thePortID.addPortOwnershipListener(new MyResolver());
	
Methods Summary
public voidconverse()

		// lah de dah...
		// To simulate a long conversation on the port...
		
		try {
			Thread.sleep(1000 * 1000);
		} catch (InterruptedException cantHappen) {
			//
		}
	
public static voidmain(java.lang.String[] argv)


		if (argv.length != 1) {
			System.err.println("Usage: PortOwner aname");
			System.exit(1);
		}
			
		new PortOwner(argv[0]).converse();

		System.exit(0);