|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.net.SocketOptions
public class SocketOptions
SocketOptions provides a means to configure the various aspects of Sockets. Unlike java.net.SocketOptions, unset options will result in a value of null when queried via getOption.
Field Summary | |
---|---|
protected java.util.Map |
m_mapOptions A map of the specified options. |
protected XmlElement |
m_xml The configuration. |
protected static boolean |
s_fWarnReuseAddr Tracks if a configuration warning has been issued for SO_REUSEADDR |
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 | |
---|---|
SocketOptions() |
Method Summary | |
---|---|
void |
apply(java.net.DatagramSocket socket) Configure the specified socket. |
void |
apply(java.net.MulticastSocket socket) Configure the specified socket. |
void |
apply(java.net.ServerSocket socket) Configure the specified socket. |
void |
apply(java.net.Socket socket) Configure the specified socket. |
static void |
apply(java.net.SocketOptions options, java.net.DatagramSocket socket) Apply the specified options to a socket. |
void |
apply(java.net.SocketOptions options, java.net.MulticastSocket socket) Apply the specified options to a socket. |
static void |
apply(java.net.SocketOptions options, java.net.ServerSocket socket) Apply the specified options to a socket. |
static void |
apply(java.net.SocketOptions options, java.net.Socket socket) Apply the specified options to a socket. |
void |
copyOptions(java.net.SocketOptions options) Copy the options in the specified SocketOptions into this SocketOptions. |
XmlElement |
getConfig() Determine the current configuration of the object. |
java.lang.Object |
getOption(int optID) |
boolean |
isConfigured() Return true iff the XmlSocketOptions have been configured with any options. |
static SocketOptions |
load(XmlElement xml) Parse the supplied XML and return the corresponding SocketOptions. |
void |
setConfig(XmlElement xml) Specify the configuration for the object. |
void |
setOption(int optID, java.lang.Object value) |
java.lang.String |
toString() |
protected static void |
warnBufferSize(java.lang.Object socket, java.lang.String sBuffer, int cb, int cbReal) Issue a warning regarding an undersized socket buffer. |
protected static void |
warnReuseAddr(boolean fReuse) Issue a warning regarding overrideing SO_REUSEADDR |
Field Detail |
---|
protected XmlElement m_xml
protected java.util.Map m_mapOptions
protected static boolean s_fWarnReuseAddr
Constructor Detail |
---|
public SocketOptions()
Method Detail |
---|
public boolean isConfigured()
public void apply(java.net.ServerSocket socket) throws java.net.SocketException
socket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic void apply(java.net.Socket socket) throws java.net.SocketException
socket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic void apply(java.net.DatagramSocket socket) throws java.net.SocketException
socket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic void apply(java.net.MulticastSocket socket) throws java.net.SocketException
socket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic XmlElement getConfig()
getConfig
in interface XmlConfigurable
public void setConfig(XmlElement xml)
setConfig
in interface XmlConfigurable
xml
- the XML configuration for the objectpublic void setOption(int optID, java.lang.Object value) throws java.net.SocketException
setOption
in interface java.net.SocketOptions
java.net.SocketException
public java.lang.Object getOption(int optID) throws java.net.SocketException
getOption
in interface java.net.SocketOptions
java.net.SocketException
public void copyOptions(java.net.SocketOptions options) throws java.net.SocketException
options
- the options to copyjava.net.SocketException
- if an error occurspublic java.lang.String toString()
protected static void warnBufferSize(java.lang.Object socket, java.lang.String sBuffer, int cb, int cbReal)
socket
- the socketsBuffer
- the buffer descriptioncb
- the requested sizecbReal
- the actual sizeprotected static void warnReuseAddr(boolean fReuse)
fReuse
- the specified settingpublic static SocketOptions load(XmlElement xml)
xml
- the xml configuraitonpublic static void apply(java.net.SocketOptions options, java.net.ServerSocket socket) throws java.net.SocketException
options
- the options to applysocket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic static void apply(java.net.SocketOptions options, java.net.Socket socket) throws java.net.SocketException
options
- the options to applysocket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic static void apply(java.net.SocketOptions options, java.net.DatagramSocket socket) throws java.net.SocketException
options
- the options to applysocket
- the socket to configurejava.net.SocketException
- if an I/O error occurspublic void apply(java.net.SocketOptions options, java.net.MulticastSocket socket) throws java.net.SocketException
options
- the options to applysocket
- the socket to configurejava.net.SocketException
- if an I/O error occurs
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |