public class MulticastTransport extends Thread implements Transport
The MulticastTransport will send strings across a specified multicast address. It will also listen for messages and hand them to the appropriate DatagramHandler.
Constructor and Description |
---|
MulticastTransport(DatagramHandler handler,
String multicastAddress,
int port,
String bindAddress) |
Modifier and Type | Method and Description |
---|---|
void |
connect() |
void |
disconnect() |
boolean |
isConnected() |
void |
run() |
void |
sendMessage(byte[] bytes) |
void |
sendMessage(String message) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public MulticastTransport(DatagramHandler handler, String multicastAddress, int port, String bindAddress)
public void connect() throws IOException
public void disconnect()
disconnect
in interface Transport
public boolean isConnected()
isConnected
in interface Transport
public void run()
run
in interface Runnable
run
in class Thread
public void sendMessage(byte[] bytes) throws IOException
IOException
public void sendMessage(String message) throws IOException
sendMessage
in interface Transport
IOException