|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wimpi.modbus.net.TCPMasterConnection
public class TCPMasterConnection
Class that implements a TCPMasterConnection.
| Field Summary | |
|---|---|
private InetAddress |
m_Address
|
private boolean |
m_Connected
|
private ModbusTCPTransport |
m_ModbusTransport
|
private int |
m_Port
|
private Socket |
m_Socket
|
private int |
m_Timeout
|
| Constructor Summary | |
|---|---|
TCPMasterConnection(InetAddress adr)
Constructs a TCPMasterConnection instance with a given destination address. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this TCPMasterConnection. |
void |
connect()
Opens this TCPMasterConnection. |
InetAddress |
getAddress()
Returns the destination InetAddress of this TCPMasterConnection. |
ModbusTransport |
getModbusTransport()
Returns the ModbusTransport associated with this TCPMasterConnection. |
int |
getPort()
Returns the destination port of this TCPMasterConnection. |
int |
getTimeout()
Returns the timeout for this TCPMasterConnection. |
boolean |
isConnected()
Tests if this TCPMasterConnection is connected. |
private void |
prepareTransport()
Prepares the associated ModbusTransport of this TCPMasterConnection for use. |
void |
setAddress(InetAddress adr)
Sets the destination InetAddress of this TCPMasterConnection. |
void |
setPort(int port)
Sets the destination port of this TCPMasterConnection. |
void |
setTimeout(int timeout)
Sets the timeout for this TCPMasterConnection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Socket m_Socket
private int m_Timeout
private boolean m_Connected
private InetAddress m_Address
private int m_Port
private ModbusTCPTransport m_ModbusTransport
| Constructor Detail |
|---|
public TCPMasterConnection(InetAddress adr)
adr - the destination InetAddress.| Method Detail |
|---|
public void connect()
throws Exception
Exception - if there is a network failure.public void close()
public ModbusTransport getModbusTransport()
private void prepareTransport()
throws IOException
IOException - if an I/O related error occurs.public int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout as int.public int getPort()
public void setPort(int port)
port - the port number as int.public InetAddress getAddress()
public void setAddress(InetAddress adr)
adr - the destination address as InetAddress.public boolean isConnected()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||