jmce.sim.serial
Class TCPClient
java.lang.Object
jmce.sim.AbstractHardware
jmce.sim.AbstractPeripheral
jmce.sim.Device<java.lang.Integer>
jmce.sim.Serial
jmce.sim.serial.PolledSerial
jmce.sim.serial.TCPSocket
jmce.sim.serial.TCPClient
- All Implemented Interfaces:
- java.lang.Runnable, Console, DeviceConsumer<java.lang.Integer>, Hardware, Peripheral
public class TCPClient
- extends TCPSocket
Sample client device.
This class connect the socket to specified host and port.
- Version:
- 1.01
- Author:
- Mario Viara
Constructor Summary |
TCPClient()
Default constructor |
TCPClient(int port)
Constructor with specified port the local host is used. |
TCPClient(java.lang.String host,
int port)
Constructor with specified host and port |
Method Summary |
protected void |
connect()
Implemented by sub class. |
java.lang.String |
getHost()
Get the host |
void |
setHost(java.lang.String host)
Set the host |
java.lang.String |
toString()
|
Methods inherited from class jmce.sim.Device |
addInputConsumer, addInputProducer, addOutputConsumer, addOutputProducer, getConnected, read, readOutput, readyRead, readyReadOutput, readyWrite, removeInputConsumer, removeOutputConsumer, setConnected, write, writeInput |
Methods inherited from class jmce.sim.AbstractHardware |
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface jmce.sim.Hardware |
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName |
TCPClient
public TCPClient(java.lang.String host,
int port)
- Constructor with specified host and port
TCPClient
public TCPClient(int port)
- Constructor with specified port the local host is used.
TCPClient
public TCPClient()
- Default constructor
setHost
public void setHost(java.lang.String host)
- Set the host
getHost
public java.lang.String getHost()
- Get the host
connect
protected void connect()
throws java.lang.Exception
- Description copied from class:
PolledSerial
- Implemented by sub class.
Must set the stream to the appropriated value and set
connected true.
- Specified by:
connect
in class PolledSerial
- Throws:
java.lang.Exception
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractHardware