|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.DatagramSocket
seda.nbio.NonblockingDatagramSocket
seda.nbio.NonblockingMulticastSocket
public class NonblockingMulticastSocket
NonblockingMulticastSocket provides non-blocking multicast datagram I/O. NOTE: packets cannot be received on a socket once connect() is called, due to the semantics of connect() for multicast sockets. Instead, applications should generally use joinGroup(), and then explicitly specify the group address as the destination in all the outbound packets.
Field Summary | |
---|---|
(package private) java.net.InetAddress |
multicast_interface
|
(package private) int |
multicast_ttl
|
Fields inherited from class seda.nbio.NonblockingDatagramSocket |
---|
impl, is_connected |
Fields inherited from interface seda.nbio.Selectable |
---|
ACCEPT_READY, CONNECT_READY, READ_READY, SELECT_ERROR, WRITE_READY |
Constructor Summary | |
---|---|
NonblockingMulticastSocket()
Create a NonblockingMulticastSocket bound to any available port. |
|
NonblockingMulticastSocket(int port)
|
|
NonblockingMulticastSocket(int port,
java.net.InetAddress laddr)
Create a NonblockingMulticastSocket bound to the given port and the given local address. |
Method Summary | |
---|---|
java.net.InetAddress |
getInterface()
Get the interface associated with this multicast socket |
int |
getTimeToLive()
get the multicast ttl |
void |
joinGroup(java.net.InetAddress addr)
Join a multicast group |
void |
leaveGroup(java.net.InetAddress addr)
Leave a multicast group |
void |
seeLocalMessages(boolean state)
This sets the state of the IP_MULTICAST_LOOP option on the underlying socket. |
void |
setInterface(java.net.InetAddress addr)
Set the interface associated with this socket |
void |
setTimeToLive(int ttl)
set the time to live |
Methods inherited from class seda.nbio.NonblockingDatagramSocket |
---|
close, connect, connect, disconnect, getInetAddress, getLocalAddress, getLocalPort, getPort, getReceiveBufferSize, getSendBufferSize, nbReceive, nbReceive, nbSend, nbSend, nbSend, receive, send, setReceiveBufferSize, setSendBufferSize |
Methods inherited from class java.net.DatagramSocket |
---|
bind, connect, getBroadcast, getChannel, getLocalSocketAddress, getRemoteSocketAddress, getReuseAddress, getSoTimeout, getTrafficClass, isBound, isClosed, isConnected, setBroadcast, setDatagramSocketImplFactory, setReuseAddress, setSoTimeout, setTrafficClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.net.InetAddress multicast_interface
int multicast_ttl
Constructor Detail |
---|
public NonblockingMulticastSocket() throws java.io.IOException
java.io.IOException
public NonblockingMulticastSocket(int port) throws java.io.IOException
java.io.IOException
public NonblockingMulticastSocket(int port, java.net.InetAddress laddr) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void joinGroup(java.net.InetAddress addr) throws java.io.IOException
java.io.IOException
public void leaveGroup(java.net.InetAddress addr) throws java.io.IOException
java.io.IOException
public int getTimeToLive() throws java.io.IOException
java.io.IOException
public void setTimeToLive(int ttl) throws java.io.IOException
java.io.IOException
public java.net.InetAddress getInterface()
public void setInterface(java.net.InetAddress addr) throws java.io.IOException
java.io.IOException
public void seeLocalMessages(boolean state) throws java.io.IOException
NOTE: The behavior of this is somewhat strange for two multicast listeners on the same physical machine. Ideally, this should be an incoming filter - each socket should throw out packets that it sent out, and not deliver them to the application.
Unfortunately, this instead seems to be an outbound filter - all packets sent out on a socket with IP_MULTICAST_LOOP turned off will be invisible to all sockets on the local machine - regardless of whether or not these other sockets have specified IP_MULTICAST_LOOP=false.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |