FileDocCategorySizeDatePackage
CommPortThreaded.javaAPI DocExample1917Sun Apr 11 19:50:40 BST 2004None

CommPortThreaded

public class CommPortThreaded extends CommPortOpen
This program tries to do I/O in each direction using a separate Thread.
author
Ian F. Darwin, http://www.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);
		}