Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.net
Class SocketOptions

java.lang.Object
  extended by com.tangosol.net.SocketOptions

All Implemented Interfaces:
XmlConfigurable, SocketOptions

public class SocketOptions
extends Object
implements SocketOptions, XmlConfigurable

SocketOptions provides a means to configure the various aspects of Sockets.

Since:
Coherence 3.6
Author:
mf 2010.05.20

Field Summary
protected  Map m_mapOptions
          A map of the specified options.
protected  XmlElement m_xml
          The configuration.

 

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(DatagramSocket socket)
          Configure the specified socket.
 void apply(MulticastSocket socket)
          Configure the specified socket.
 void apply(ServerSocket socket)
          Configure the specified socket.
 void apply(Socket socket)
          Configure the specified socket.
static void apply(SocketOptions options, DatagramSocket socket)
          Apply the specified options to a socket.
 void apply(SocketOptions options, MulticastSocket socket)
          Apply the specified options to a socket.
static void apply(SocketOptions options, ServerSocket socket)
          Apply the specified options to a socket.
static void apply(SocketOptions options, Socket socket)
          Apply the specified options to a socket.
 XmlElement getConfig()
          Determine the current configuration of the object.
 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, Object value)
          
 String toString()
          
protected static void warnBufferSize(Object socket, String sBuffer, int cb, int cbReal)
          Issue a warning regarding an undersized socket buffer.

 

Field Detail

m_xml

protected XmlElement m_xml
The configuration.

m_mapOptions

protected Map m_mapOptions
A map of the specified options.

Constructor Detail

SocketOptions

public SocketOptions()

Method Detail

isConfigured

public boolean isConfigured()
Return true iff the XmlSocketOptions have been configured with any options.
Returns:
true iff the XmlSocketOptions have been configured with any options.

apply

public void apply(ServerSocket socket)
           throws SocketException
Configure the specified socket.
Parameters:
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

apply

public void apply(Socket socket)
           throws SocketException
Configure the specified socket.
Parameters:
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

apply

public void apply(DatagramSocket socket)
           throws SocketException
Configure the specified socket.
Parameters:
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

apply

public void apply(MulticastSocket socket)
           throws SocketException
Configure the specified socket.
Parameters:
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

getConfig

public XmlElement getConfig()
Determine the current configuration of the object.
Specified by:
getConfig in interface XmlConfigurable
Returns:
the XML configuration or null

setConfig

public void setConfig(XmlElement xml)
Specify the configuration for the object.
Specified by:
setConfig in interface XmlConfigurable
Parameters:
xml - the XML configuration for the object

setOption

public void setOption(int optID,
                      Object value)
               throws SocketException
Specified by:
setOption in interface SocketOptions
Throws:
SocketException

getOption

public Object getOption(int optID)
                 throws SocketException
Specified by:
getOption in interface SocketOptions
Throws:
SocketException

toString

public String toString()

warnBufferSize

protected static void warnBufferSize(Object socket,
                                     String sBuffer,
                                     int cb,
                                     int cbReal)
Issue a warning regarding an undersized socket buffer.
Parameters:
socket - the socket
sBuffer - the buffer description
cb - the requested size
cbReal - the actual size

load

public static SocketOptions load(XmlElement xml)
Parse the supplied XML and return the corresponding SocketOptions.
Parameters:
xml - the xml configuraiton
Returns:
the options, or null if none were identified

apply

public static void apply(SocketOptions options,
                         ServerSocket socket)
                  throws SocketException
Apply the specified options to a socket.
Parameters:
options - the options to apply
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

apply

public static void apply(SocketOptions options,
                         Socket socket)
                  throws SocketException
Apply the specified options to a socket.
Parameters:
options - the options to apply
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

apply

public static void apply(SocketOptions options,
                         DatagramSocket socket)
                  throws SocketException
Apply the specified options to a socket.
Parameters:
options - the options to apply
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

apply

public void apply(SocketOptions options,
                  MulticastSocket socket)
           throws SocketException
Apply the specified options to a socket.
Parameters:
options - the options to apply
socket - the socket to configure
Throws:
SocketException - if an I/O error occurs

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.