public class UDPTransport
extends java.lang.Object
Constructor and Description |
---|
UDPTransport() |
UDPTransport(boolean isBroadcastEnable,
boolean isMulticastEnable,
int bindPort,
int numberOfSenderThreads) |
UDPTransport(boolean isBroadcastEnable,
int bindPort,
int numberOfSenderThreads) |
UDPTransport(IMCDefinition defs) |
UDPTransport(int numberOfSenderThreads) |
UDPTransport(int bindPort,
int numberOfSenderThreads) |
UDPTransport(java.lang.String multicastAddress,
int bindPort) |
UDPTransport(java.lang.String multicastAddress,
int bindPort,
int numberOfSenderThreads) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l,
java.util.Collection<java.lang.String> typesToListen) |
void |
addMessageListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l) |
void |
addMessageListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l,
java.util.Collection<java.lang.Integer> typesToListen) |
void |
dispatchMessage(IMCMessage req,
pt.lsts.neptus.messages.listener.MessageInfo info) |
int |
getBindPort() |
IMCDefinition |
getDefinition() |
int |
getImcId() |
int |
getMaxBufferSize() |
java.lang.String |
getMulticastAddress() |
int |
getNumberOfSenderThreads() |
int |
getTimeoutMillis() |
boolean |
isBroadcastEnable() |
boolean |
isMulticastEnable() |
boolean |
isOnBindError() |
boolean |
isRunning() |
boolean |
isStopping() |
static void |
main(java.lang.String[] args) |
void |
printStatistics() |
void |
purge()
Stops accepting new messages but waits until all the buffered
messages are sent to the network before stopping the sending thread(s).
|
void |
removeMessageListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l) |
boolean |
reStart() |
static void |
sendMessage(IMCMessage m,
java.lang.String destination,
int port) |
boolean |
sendMessage(java.lang.String destination,
int port,
IMCMessage message)
Sends a message to the network
|
void |
setBindPort(int bindPort) |
void |
setBroadcastEnable(boolean broadcastEnable) |
void |
setDefinition(IMCDefinition definition) |
void |
setImcId(int imc_id) |
void |
setIsMessageInfoNeeded(boolean b) |
void |
setMaxBufferSize(int maxBufferSize) |
void |
setMulticastAddress(java.lang.String multicastAddress) |
void |
setMulticastEnable(boolean multicastEnable) |
void |
setNumberOfSenderThreads(int numberOfSenderThreads) |
void |
setTimeoutMillis(int timeoutMillis) |
void |
stop()
Interrupts all the sending threads abruptly.
|
public UDPTransport(IMCDefinition defs)
public UDPTransport()
public UDPTransport(int numberOfSenderThreads)
numberOfSenderThreads
- public UDPTransport(int bindPort, int numberOfSenderThreads)
bindPort
- numberOfSenderThreads
- public UDPTransport(boolean isBroadcastEnable, int bindPort, int numberOfSenderThreads)
public UDPTransport(java.lang.String multicastAddress, int bindPort, int numberOfSenderThreads)
multicastAddress
- bindPort
- numberOfSenderThreads
- public UDPTransport(boolean isBroadcastEnable, boolean isMulticastEnable, int bindPort, int numberOfSenderThreads)
multicastAddress
- bindPort
- numberOfSenderThreads
- public UDPTransport(java.lang.String multicastAddress, int bindPort)
multicastAddress
- bindPort
- public IMCDefinition getDefinition()
public void setDefinition(IMCDefinition definition)
public boolean isOnBindError()
public int getBindPort()
public void setBindPort(int bindPort)
bindPort
- public java.lang.String getMulticastAddress()
public void setMulticastAddress(java.lang.String multicastAddress)
multicastAddress
- the multicastAddress to setpublic boolean isMulticastEnable()
public void setMulticastEnable(boolean multicastEnable)
multicastEnable
- the multicastEnable to setpublic boolean isBroadcastEnable()
public void setBroadcastEnable(boolean broadcastEnable)
broadcastEnable
- the broadcastEnable to setpublic int getNumberOfSenderThreads()
public void setNumberOfSenderThreads(int numberOfSenderThreads)
numberOfSenderThreads
- the numberOfSenderThreads to setpublic int getTimeoutMillis()
public void setTimeoutMillis(int timeoutMillis)
timeoutMillis
- the timeoutMillis to setpublic int getMaxBufferSize()
public void setMaxBufferSize(int maxBufferSize)
maxBufferSize
- the maxBufferSize to setpublic boolean reStart()
public void stop()
#purge()}
public void purge()
public boolean isRunning()
public boolean isStopping()
public void dispatchMessage(IMCMessage req, pt.lsts.neptus.messages.listener.MessageInfo info)
req
- info
- public void setIsMessageInfoNeeded(boolean b)
public boolean sendMessage(java.lang.String destination, int port, IMCMessage message)
destination
- A valid hostname like "whale.fe.up.pt" or "127.0.0.1"port
- The destination's portpublic void addMessageListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l, java.util.Collection<java.lang.Integer> typesToListen)
public void addListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l, java.util.Collection<java.lang.String> typesToListen)
public void addMessageListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l)
public void removeMessageListener(pt.lsts.neptus.messages.listener.MessageListener<pt.lsts.neptus.messages.listener.MessageInfo,IMCMessage> l)
public void printStatistics()
public static void sendMessage(IMCMessage m, java.lang.String destination, int port) throws java.lang.Exception
java.lang.Exception
public int getImcId()
public void setImcId(int imc_id)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception