2002-09-04 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java (DatagramSocket): Added documentation. (close): Likewise. (getLocalAddress): Likewise. (getLocalPort): Likewise. (receive): Likewise. (send): Likewise. (setSoTimeout): Likewise. (connect): New method. (disconnect): New method. (getInetAddress): New method (FIXME) (getPort): New method. (setReuseAddress): New method. (getReuseAddress): New method. (setBroadcast): New method. (getBroadcast): New method. (setTrafficClass): New method. (getTrafficClass): New method. * java/net/MulticastSocket.java): (getTTL): Added @see in documentation. (setTTL): Added @see in documentation. (setLoopbackMode): New method. (getLoopbackMode): New method. * java/net/PlainSocketImpl.java: Added new constants for the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS * java/net/PlainDatagramSocketImpl.java Added new constants for the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS * java/net/natPlainSocketImpl.cc (getOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS (setOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS This should also fix SO_KEEPALIVE * java/net/natPlainDatagramSocketImpl.cc (getOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS (setOption): Implemented the options SO_BROADCAST, SO_OOBINLINE, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS From-SVN: r56801
This commit is contained in:
parent
77e8a0cc9d
commit
7b98d4549b
7 changed files with 417 additions and 22 deletions
|
@ -114,6 +114,8 @@ public class MulticastSocket extends DatagramSocket
|
|||
* @exception IOException If an error occurs
|
||||
*
|
||||
* @deprecated 1.2 Replaced by getTimeToLive()
|
||||
*
|
||||
* @see Multicastsocket:getTimeToLive
|
||||
*/
|
||||
public byte getTTL() throws IOException
|
||||
{
|
||||
|
@ -150,6 +152,42 @@ public class MulticastSocket extends DatagramSocket
|
|||
impl.setOption(SocketOptions.IP_MULTICAST_IF, inf);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable/Enable local loopback of multicast packets. The option is used by
|
||||
* the platform's networking code as a hint for setting whether multicast
|
||||
* data will be looped back to the local socket.
|
||||
*
|
||||
* Because this option is a hint, applications that want to verify what
|
||||
* loopback mode is set to should call #getLoopbackMode
|
||||
*
|
||||
* @param disable True to disable loopback mode
|
||||
*
|
||||
* @exception SocketException If an error occurs
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
public void setLoopbackMode(boolean disable) throws SocketException
|
||||
{
|
||||
impl.setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if local loopback mode is enabled or not
|
||||
*
|
||||
* @exception SocketException If an error occurs
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
public boolean getLoopbackMode() throws SocketException
|
||||
{
|
||||
Object obj = impl.getOption (SocketOptions.IP_MULTICAST_LOOP);
|
||||
|
||||
if (obj instanceof Boolean)
|
||||
return ((Boolean) obj).booleanValue ();
|
||||
else
|
||||
throw new SocketException ("Unexpected type");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the "Time to Live" value for a socket. The value must be between
|
||||
* 1 and 255.
|
||||
|
@ -159,6 +197,8 @@ public class MulticastSocket extends DatagramSocket
|
|||
* @exception IOException If an error occurs
|
||||
*
|
||||
* @deprecated 1.2 Replaced by <code>setTimeToLive</code>
|
||||
*
|
||||
* @see MulticastSocket:setTimeToLive
|
||||
*/
|
||||
public void setTTL(byte ttl) throws IOException
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue