jamod at SF

net.wimpi.modbus.net
Class UDPMasterConnection

java.lang.Object
  extended bynet.wimpi.modbus.net.UDPMasterConnection

public class UDPMasterConnection
extends java.lang.Object

Class that implements a UDPMasterConnection.

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger

Constructor Summary
UDPMasterConnection(java.net.InetAddress adr)
          Constructs a UDPMasterConnection instance with a given destination address.
 
Method Summary
 void close()
          Closes this UDPMasterConnection.
 void connect()
          Opens this UDPMasterConnection.
 java.net.InetAddress getAddress()
          Returns the destination InetAddress of this UDPMasterConnection.
 ModbusTransport getModbusTransport()
          Returns the ModbusTransport associated with this UDPMasterConnection.
 int getPort()
          Returns the destination port of this UDPMasterConnection.
 UDPTerminal getTerminal()
          Returns the terminal used for handling the package traffic.
 int getTimeout()
          Returns the timeout for this UDPMasterConnection.
 boolean isConnected()
          Tests if this UDPMasterConnection is connected.
 void setAddress(java.net.InetAddress adr)
          Sets the destination InetAddress of this UDPMasterConnection.
 void setPort(int port)
          Sets the destination port of this UDPMasterConnection.
 void setTimeout(int timeout)
          Sets the timeout for this UDPMasterConnection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPMasterConnection

public UDPMasterConnection(java.net.InetAddress adr)
Constructs a UDPMasterConnection instance with a given destination address.

Parameters:
adr - the destination InetAddress.
Method Detail

connect

public void connect()
             throws java.lang.Exception
Opens this UDPMasterConnection.

Throws:
java.lang.Exception - if there is a network failure.

close

public void close()
Closes this UDPMasterConnection.


getModbusTransport

public ModbusTransport getModbusTransport()
Returns the ModbusTransport associated with this UDPMasterConnection.

Returns:
the connection's ModbusTransport.

getTerminal

public UDPTerminal getTerminal()
Returns the terminal used for handling the package traffic.

Returns:
a UDPTerminal instance.

getTimeout

public int getTimeout()
Returns the timeout for this UDPMasterConnection.

Returns:
the timeout as int.

setTimeout

public void setTimeout(int timeout)
Sets the timeout for this UDPMasterConnection.

Parameters:
timeout - the timeout as int.

getPort

public int getPort()
Returns the destination port of this UDPMasterConnection.

Returns:
the port number as int.

setPort

public void setPort(int port)
Sets the destination port of this UDPMasterConnection. The default is defined as Modbus.DEFAULT_PORT.

Parameters:
port - the port number as int.

getAddress

public java.net.InetAddress getAddress()
Returns the destination InetAddress of this UDPMasterConnection.

Returns:
the destination address as InetAddress.

setAddress

public void setAddress(java.net.InetAddress adr)
Sets the destination InetAddress of this UDPMasterConnection.

Parameters:
adr - the destination address as InetAddress.

isConnected

public boolean isConnected()
Tests if this UDPMasterConnection is connected.

Returns:
true if connected, false otherwise.

jamod at SF

Copyright © 2002-2004 jamod development team.