Sea 0.4.0

gov.lbl.dsd.sea.nio.util
Class SocketOpts

java.lang.Object
  extended bygov.lbl.dsd.sea.nio.util.SocketOpts
All Implemented Interfaces:
Serializable, SocketOptions

public class SocketOpts
extends Object
implements SocketOptions, Serializable

Convenience class to get and set socket options; see SocketOptions and Socketfor the corresponding keys and values.

For TCP performance tuning, see http://dsd.lbl.gov/TCP-tuning/ and in particular http://dsd.lbl.gov/TCP-tuning/buffers.html for how to increase the max socket buffer sizes allowed by the operating system (for MacOSX use the FreeBSD instructions as root user). Further useful information: http://www.psc.edu/networking/perf_tune.html

Version:
$Revision: 1.3 $, $Date: 2004/05/31 22:09:11 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface java.net.SocketOptions
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY
 
Constructor Summary
SocketOpts()
          Creates an empty object (with all options yet undefined).
SocketOpts(Socket socket)
          Constructs and object containing the options of the given socket.
 
Method Summary
 void copyTo(Socket socket)
          Copies the options from this object to the given socket.
 Object getOption(int optID)
          Returns the given option
 void setOption(int optID, Object value)
          Sets the given option to the given value.
 String toString()
          Returns a detailed string representation of the receiver.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketOpts

public SocketOpts()
Creates an empty object (with all options yet undefined).


SocketOpts

public SocketOpts(Socket socket)
           throws SocketException
Constructs and object containing the options of the given socket.

Method Detail

setOption

public void setOption(int optID,
                      Object value)
Sets the given option to the given value.

Specified by:
setOption in interface SocketOptions
See Also:
SocketOptions.setOption(int, java.lang.Object)

getOption

public Object getOption(int optID)
Returns the given option

Specified by:
getOption in interface SocketOptions
See Also:
SocketOptions.getOption(int)

copyTo

public void copyTo(Socket socket)
            throws SocketException
Copies the options from this object to the given socket.

Throws:
SocketException

toString

public String toString()
Returns a detailed string representation of the receiver.


Sea 0.4.0