|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.thread.ThreadService SK.gnome.dwarf.tcpip.Listener SK.gnome.dwarf.tcpip.UDPListener SK.gnome.dwarf.tcpip.MulticastUDPListener
Service for receiving multicast client datagrams.
It listenes on a specified port and address and passes the received datagrams
to TCPIPServer
for further processing.
This listener overrides the getDatagramSocket()
method to return the
java.net.MulticastSocket instances.
The setGroups(String)
method may be used to set the initial multicast
groups the listener will listen to.
Field Summary | |
protected java.util.Set |
groups
The initial multicast groups. |
protected java.net.InetAddress |
iface
The interface to listen on. |
Fields inherited from class SK.gnome.dwarf.tcpip.UDPListener |
connectAddress, connectPort, packetSize, socket |
Fields inherited from class SK.gnome.dwarf.tcpip.Listener |
address, allowedHosts, deniedHosts, port |
Fields inherited from class SK.gnome.dwarf.thread.ThreadService |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
MulticastUDPListener(java.lang.String name)
Creates a new MulticastUDPListener. |
Method Summary | |
protected java.net.DatagramSocket |
getDatagramSocket()
Returns the datagram socket. |
void |
setGroups(java.lang.String groups)
Sets the initial multicast groups. |
void |
setInterface(java.net.InetAddress iface)
Sets the interface to listen on. |
Methods inherited from class SK.gnome.dwarf.tcpip.UDPListener |
enableThread, finish, getDatagramPacket, init, loop, setConnectAddress, setConnectPort, setPacketSize |
Methods inherited from class SK.gnome.dwarf.tcpip.Listener |
acceptHost, setAddress, setAllowedHosts, setDeniedHosts, setPort |
Methods inherited from class SK.gnome.dwarf.thread.ThreadService |
run, setDaemon, shutdown, start, stop |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.net.InetAddress iface
setInterface(InetAddress)
protected java.util.Set groups
The set elements are of type java.net.InetAddress.
setGroups(String)
Constructor Detail |
public MulticastUDPListener(java.lang.String name)
Method Detail |
public void setInterface(java.net.InetAddress iface)
iface
- the interfaceiface
public void setGroups(java.lang.String groups) throws java.net.UnknownHostException
A comma-separated list of either multicast hostnames or multicast IP addresses must be specified.
groups
- the comma-separated list of hosts
java.net.UnknownHostException
- if the internet host is not found
java.lang.IllegalArgumentException
- if a specified address is not multicastgroups
protected java.net.DatagramSocket getDatagramSocket() throws ServiceException
Returns the java.net.MulticastSocket for listening. The returned socket will
be bound to the Listener.port
. If the iface
field is null, the socket will use all
available interfaces, otherwise it will use just the specified interface. If groups
contains any elements, the socket will join the specified groups before returned from this
method.
getDatagramSocket
in class UDPListener
ServiceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |