FileDocCategorySizeDatePackage
CommPortThreaded.javaAPI DocExample1529Sat Nov 25 12:55:34 GMT 2000None

CommPortThreaded

public class CommPortThreaded extends CommPortOpen
This program tries to do I/O in each direction using a separate Thread.
author
Ian F. Darwin, ian@darwinsys.com

Fields Summary
Constructors Summary
public CommPortThreaded()

		super(null);
	
Methods Summary
protected voidconverse()
This version of converse() just starts a Thread in each direction.


		String resp;		// the modem response.

		new DataThread(is, System.out).start();
		new DataThread(new DataInputStream(System.in), os).start();

	
public static voidmain(java.lang.String[] ap)

		CommPortThreaded cp;
		try {
			cp = new CommPortThreaded();
			cp.converse();
		} catch(Exception e) {
			System.err.println("You lose!");
			System.err.println(e);
		}