|
|||||||||
| Home >> All >> java >> [ net overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.net
Interface SocketOptions

- All Known Implementing Classes:
- DatagramSocketImpl, SocketImpl
- public interface SocketOptions
This interface is used by SocketImpl and
DatagramSocketImpl to implement options
on sockets.
- Since:
- 1.2
| Field Summary | |
static int |
IP_MULTICAST_IF
Options id for the IP_MULTICAST_IF value |
static int |
IP_MULTICAST_IF2
same as above |
static int |
IP_MULTICAST_LOOP
This option enables or disables local loopback of multicast datagrams. |
static int |
IP_TOS
This option sets the type-of-service or traffic class field in the IP header for a TCP or UDP socket. |
static int |
SO_BINDADDR
Retrieve the local address to which the socket is bound. |
static int |
SO_BROADCAST
Sets SO_BROADCAST for a socket |
static int |
SO_KEEPALIVE
Option id for the SO_KEEPALIVE value |
static int |
SO_LINGER
Option id for the SO_LINGER value |
static int |
SO_OOBINLINE
Sets SO_OOBINLINE for a socket |
static int |
SO_RCVBUF
Option id for the receive buffer size |
static int |
SO_REUSEADDR
Sets the SO_REUSEADDR parameter on a socket |
static int |
SO_SNDBUF
Option id for the send buffer size |
static int |
SO_TIMEOUT
Option id for the SO_TIMEOUT value |
static int |
TCP_NODELAY
Option id for the TCP_NODELAY value |
| Method Summary | |
java.lang.Object |
getOption(int optionId)
Returns the current setting of the specified option. |
void |
setOption(int optionId,
java.lang.Object val)
Sets the specified option on a socket to the passed in object. |
| Field Detail |
SO_KEEPALIVE
public static final int SO_KEEPALIVE
- Option id for the SO_KEEPALIVE value
- Since:
- 1.3
- See Also:
- Constant Field Values
SO_LINGER
public static final int SO_LINGER
- Option id for the SO_LINGER value
- See Also:
- Constant Field Values
SO_TIMEOUT
public static final int SO_TIMEOUT
- Option id for the SO_TIMEOUT value
- See Also:
- Constant Field Values
SO_BINDADDR
public static final int SO_BINDADDR
- Retrieve the local address to which the socket is bound.
- See Also:
- Constant Field Values
SO_SNDBUF
public static final int SO_SNDBUF
- Option id for the send buffer size
- Since:
- 1.2
- See Also:
- Constant Field Values
SO_RCVBUF
public static final int SO_RCVBUF
- Option id for the receive buffer size
- Since:
- 1.2
- See Also:
- Constant Field Values
SO_REUSEADDR
public static final int SO_REUSEADDR
- Sets the SO_REUSEADDR parameter on a socket
- See Also:
- Constant Field Values
SO_BROADCAST
public static final int SO_BROADCAST
- Sets SO_BROADCAST for a socket
- Since:
- 1.4
- See Also:
- Constant Field Values
SO_OOBINLINE
public static final int SO_OOBINLINE
- Sets SO_OOBINLINE for a socket
- Since:
- 1.4
- See Also:
- Constant Field Values
TCP_NODELAY
public static final int TCP_NODELAY
- Option id for the TCP_NODELAY value
- See Also:
- Constant Field Values
IP_MULTICAST_IF
public static final int IP_MULTICAST_IF
- Options id for the IP_MULTICAST_IF value
- See Also:
- Constant Field Values
IP_MULTICAST_IF2
public static final int IP_MULTICAST_IF2
- same as above
- Since:
- 1.4
- See Also:
- Constant Field Values
IP_MULTICAST_LOOP
public static final int IP_MULTICAST_LOOP
- This option enables or disables local loopback of multicast datagrams.
- Since:
- 1.4
- See Also:
- Constant Field Values
IP_TOS
public static final int IP_TOS
- This option sets the type-of-service or traffic class field in the
IP header for a TCP or UDP socket.
- Since:
- 1.4
- See Also:
- Constant Field Values
| Method Detail |
setOption
public void setOption(int optionId,
java.lang.Object val)
throws SocketException
- Sets the specified option on a socket to the passed in object. For
options that take an integer argument, the passed in object is an
Integer. For options that are set to on or off, the value passed will be aBoolean. TheoptionIdparameter is one of the defined constants in this interface.
getOption
public java.lang.Object getOption(int optionId) throws SocketException
- Returns the current setting of the specified option. The
Objectreturned will be anIntegerfor options that have integer values. For options that are set to on or off, aBooleanwill be returned. TheoptionIdparameter is one of the defined constants in this interface.
|
|||||||||
| Home >> All >> java >> [ net overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC