public class CARepeater extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
static String |
CA_DISABLE_REPEATER
System JVM property key to disable CA repeater.
|
static String |
CA_FORCE_NATIVE_REPEATER
System JVM property key to force native repeater.
|
protected List |
clients
List of registered clients.
|
protected DatagramSocket |
localDatagramSocket
Local unbounded DatagramSocket.
|
protected Logger |
logger
Context logger.
|
protected int |
repeaterPort
Repeater port.
|
| Constructor and Description |
|---|
CARepeater()
Constructor.
|
CARepeater(int repeaterPort)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected static DatagramSocket |
createDatagramSocket()
Constructs an unbound datagram socket.
|
protected static DatagramSocket |
createDatagramSocket(int port,
boolean reuseAddress)
Constructs a atagram socket bound to the wildcard address on defined port.
|
protected void |
fanOut(InetSocketAddress fromAddress,
ByteBuffer buffer) |
protected void |
initialize()
Initialize CA repeater.
|
protected void |
initializeLogger()
Initialize context logger.
|
protected static boolean |
isRepeaterRunning(int repeaterPort)
Check if repeater is running.
|
static void |
main(String[] argv)
Main entry-point.
|
protected void |
process()
Process UDP requests.
|
protected void |
registerNewClient(InetSocketAddress clientAddress) |
void |
run() |
static void |
startRepeater(int repeaterPort)
Start repeater as detached process.
|
protected void |
verifyClients()
Verify all the clients.
|
public static final String CA_FORCE_NATIVE_REPEATER
public static final String CA_DISABLE_REPEATER
protected Logger logger
protected int repeaterPort
protected DatagramSocket localDatagramSocket
protected List clients
public CARepeater()
public CARepeater(int repeaterPort)
repeaterPort - repeater port.protected void initialize()
protected void initializeLogger()
public void run()
run in interface RunnableRunnable.run()protected void registerNewClient(InetSocketAddress clientAddress)
protected void fanOut(InetSocketAddress fromAddress, ByteBuffer buffer)
protected void verifyClients()
protected void process()
protected static DatagramSocket createDatagramSocket() throws SocketException
SocketException - - if the socket could not be opened, or the socket could not bind to the specified local port.protected static DatagramSocket createDatagramSocket(int port, boolean reuseAddress) throws SocketException
port - InetSocketAddressreuseAddress - Enable/disable the SO_REUSEADDR socket optionSocketException - - if the socket could not be opened, or the socket could not bind to the specified local port.protected static boolean isRepeaterRunning(int repeaterPort)
repeaterPort - repeater port.true if repeater is already running, false otherwisepublic static void startRepeater(int repeaterPort)
throws Throwable
repeaterPort - repeater port.Throwable - throwablepublic static void main(String[] argv)
argv - arguments.Copyright © 2004-2020 EPICS. All Rights Reserved.