|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wimpi.modbus.net.ModbusTCPListener
public class ModbusTCPListener
Class that implements a ModbusTCPListener.
If listening, it accepts incoming requests
passing them on to be handled.
| Field Summary | |
|---|---|
private static int |
c_RequestCounter
|
private InetAddress |
m_Address
|
private int |
m_FloodProtection
|
private Thread |
m_Listener
|
private boolean |
m_Listening
|
private int |
m_Port
|
private ServerSocket |
m_ServerSocket
|
private ThreadPool |
m_ThreadPool
|
private static int |
REQUESTS_TOGC
|
| Constructor Summary | |
|---|---|
ModbusTCPListener(int poolsize)
Constructs a ModbusTCPListener instance. |
|
ModbusTCPListener(int poolsize,
InetAddress addr)
Constructs a ModbusTCPListener instance. |
|
| Method Summary | |
|---|---|
private void |
count()
|
boolean |
isListening()
Tests if this ModbusTCPListener is listening and accepting incoming connections. |
void |
run()
Accepts incoming connections and handles then with TCPConnectionHandler instances. |
void |
setAddress(InetAddress addr)
Sets the address of the interface to be listened to. |
void |
setPort(int port)
Sets the port to be listened to. |
void |
start()
Starts this ModbusTCPListener. |
void |
stop()
Stops this ModbusTCPListener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static int c_RequestCounter
private ServerSocket m_ServerSocket
private ThreadPool m_ThreadPool
private Thread m_Listener
private int m_Port
private int m_FloodProtection
private boolean m_Listening
private InetAddress m_Address
private static final int REQUESTS_TOGC
| Constructor Detail |
|---|
public ModbusTCPListener(int poolsize)
poolsize - the size of the ThreadPool used to handle
incoming requests.
public ModbusTCPListener(int poolsize,
InetAddress addr)
poolsize - the size of the ThreadPool used to handle
incoming requests.addr - the interface to use for listening.| Method Detail |
|---|
public void setPort(int port)
port - the number of the IP port as int.public void setAddress(InetAddress addr)
addr - an InetAddress instance.public void start()
public void stop()
public void run()
run in interface Runnablepublic boolean isListening()
private void count()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||