portcomms
Class PortOwner
java.lang.Object
portcomms.OpenCommPort
portcomms.PortOwner
public class PortOwner
- extends OpenCommPort
Demonstrate the port conflict resolution mechanism.
Run two copies of this program and choose the same port in each.
|
Nested Class Summary |
(package private) class |
PortOwner.MyResolver
An inner class that handles the ports conflict resolution. |
|
Field Summary |
(package private) java.lang.String |
myName
A name for showing which of several instances of this program |
| Fields inherited from class portcomms.OpenCommPort |
BAUD, BITS_PER_SECOND_LIST, commPortID, debug, FLOWCONTROL_HARDWARE, FLOWCONTROL_NONE, FLOWCONTROL_XONXOFF, inputStream, outputStream, parent, response, SERIALPORT_OPEN_TIMEOUTSECONDS, thePort |
|
Constructor Summary |
PortOwner(java.lang.String name)
|
|
Method Summary |
void |
converse()
This method will be overridden by non-trivial subclasses
to hold a conversation. |
static void |
main(java.lang.String[] argv)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myName
java.lang.String myName
- A name for showing which of several instances of this program
PortOwner
public PortOwner(java.lang.String name)
throws java.io.IOException,
gnu.io.NoSuchPortException,
gnu.io.PortInUseException,
gnu.io.UnsupportedCommOperationException
- Throws:
java.io.IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException
converse
public void converse()
- Description copied from class:
OpenCommPort
- This method will be overridden by non-trivial subclasses
to hold a conversation.
- Overrides:
converse in class OpenCommPort
main
public static void main(java.lang.String[] argv)
throws java.io.IOException,
gnu.io.NoSuchPortException,
gnu.io.PortInUseException,
gnu.io.UnsupportedCommOperationException
- Throws:
java.io.IOException
gnu.io.NoSuchPortException
gnu.io.PortInUseException
gnu.io.UnsupportedCommOperationException