net.wimpi.modbus.net
Class ModbusUDPListener

java.lang.Object
  extended by net.wimpi.modbus.net.ModbusUDPListener

public class ModbusUDPListener
extends Object

Class that implements a ModbusUDPListener.

Version:
1.2 (@date@)
Author:
Dieter Wimberger

Nested Class Summary
(package private)  class ModbusUDPListener.ModbusUDPHandler
           
 
Field Summary
private  ModbusUDPListener.ModbusUDPHandler m_Handler
           
private  Thread m_HandlerThread
           
private  InetAddress m_Interface
           
private  boolean m_Listening
           
private  int m_Port
           
private  UDPSlaveTerminal m_Terminal
           
 
Constructor Summary
ModbusUDPListener()
          Constructs a new ModbusUDPListener instance.
ModbusUDPListener(InetAddress ifc)
          Create a new ModbusUDPListener instance listening to the given interface address.
 
Method Summary
 int getPort()
          Returns the number of the port this ModbusUDPListener is listening to.
 boolean isListening()
          Tests if this ModbusTCPListener is listening and accepting incoming connections.
 void setPort(int port)
          Sets the number of the port this ModbusUDPListener is listening to.
 void start()
          Starts this ModbusUDPListener.
 void stop()
          Stops this ModbusUDPListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Terminal

private UDPSlaveTerminal m_Terminal

m_Handler

private ModbusUDPListener.ModbusUDPHandler m_Handler

m_HandlerThread

private Thread m_HandlerThread

m_Port

private int m_Port

m_Listening

private boolean m_Listening

m_Interface

private InetAddress m_Interface
Constructor Detail

ModbusUDPListener

public ModbusUDPListener()
Constructs a new ModbusUDPListener instance.


ModbusUDPListener

public ModbusUDPListener(InetAddress ifc)
Create a new ModbusUDPListener instance listening to the given interface address.

Parameters:
ifc - an InetAddress instance.
Method Detail

getPort

public int getPort()
Returns the number of the port this ModbusUDPListener is listening to.

Returns:
the number of the IP port as int.

setPort

public void setPort(int port)
Sets the number of the port this ModbusUDPListener is listening to.

Parameters:
port - the number of the IP port as int.

start

public void start()
Starts this ModbusUDPListener.


stop

public void stop()
Stops this ModbusUDPListener.


isListening

public boolean isListening()
Tests if this ModbusTCPListener is listening and accepting incoming connections.

Returns:
true if listening (and accepting incoming connections), false otherwise.


Copyright © 2012. All Rights Reserved.