Package com.liferay.util.transport
Class MulticastTransport
The MulticastTransport will send strings across a specified multicast address. It will also listen for messages and hand them to the appropriate DatagramHandler.
- Author:
- Michael C. Han
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionMulticastTransport
(DatagramHandler handler, String multicastAddress, int port, String bindAddress) -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
void
boolean
void
run()
void
sendMessage
(byte[] bytes) void
sendMessage
(String message) Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
MulticastTransport
public MulticastTransport(DatagramHandler handler, String multicastAddress, int port, String bindAddress)
-
-
Method Details
-
connect
- Specified by:
connect
in interfaceTransport
- Throws:
IOException
-
disconnect
public void disconnect()- Specified by:
disconnect
in interfaceTransport
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceTransport
-
run
public void run() -
sendMessage
- Throws:
IOException
-
sendMessage
- Specified by:
sendMessage
in interfaceTransport
- Throws:
IOException
-