Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.net
Class TcpDatagramSocket

java.lang.Object
  extended by java.net.DatagramSocket
      extended by com.tangosol.net.TcpDatagramSocket

Direct Known Subclasses:
NonBlockingTcpDatagramSocket

public class TcpDatagramSocket
extends DatagramSocket

TCP based datagram socket implementation.

Author:
mf 2009.12.03

Nested Class Summary
static class TcpDatagramSocket.Impl
           

 

Field Summary
static int IO_EXCEPTIONS_LOG_LEVEL
          Debbuging flag for logging an IO exceptions which occur, set to a negative to disable the logging.
protected  TcpDatagramSocket.Impl m_impl
           

 

Constructor Summary
  TcpDatagramSocket()
           
  TcpDatagramSocket(int nPort)
           
  TcpDatagramSocket(int nPort, InetAddress addr)
           
  TcpDatagramSocket(SocketAddress addr)
           
  TcpDatagramSocket(SocketProvider provider)
           
protected TcpDatagramSocket(TcpDatagramSocket.Impl impl)
           

 

Method Summary
 void bind(SocketAddress addr)
          
 boolean isBound()
          
 SelectorProvider provider()
          Return the SelectorProvider associated with this socket.
 void receive(DatagramPacket p)
          
 void send(DatagramPacket p)
          
 void setAdvanceFrequency(int nAdvance)
          Specify the frequency at which the DatagramSocket will advance over the sub-sockets during receive.
 void setListenBacklog(int n)
          Specify the listen backlog for the server socket.
 void setPacketMagic(int nMagic, int nMask)
          Specify the packet header which is included at the start of every packet.
 void setSocketOptions(SocketOptions options)
          Specify SocketOptions to be used to configure each of the underlying TCP sockets.
 String toString()
          

 

Methods inherited from class java.net.DatagramSocket
close, connect, connect, disconnect, getBroadcast, getChannel, getInetAddress, getLocalAddress, getLocalPort, getLocalSocketAddress, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoTimeout, getTrafficClass, isClosed, isConnected, setBroadcast, setDatagramSocketImplFactory, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTrafficClass

 

Field Detail

IO_EXCEPTIONS_LOG_LEVEL

public static final int IO_EXCEPTIONS_LOG_LEVEL
Debbuging flag for logging an IO exceptions which occur, set to a negative to disable the logging.

m_impl

protected TcpDatagramSocket.Impl m_impl

Constructor Detail

TcpDatagramSocket

public TcpDatagramSocket()
                  throws SocketException
Throws:
SocketException

TcpDatagramSocket

public TcpDatagramSocket(SocketAddress addr)
                  throws SocketException
Throws:
SocketException

TcpDatagramSocket

public TcpDatagramSocket(int nPort)
                  throws SocketException
Throws:
SocketException

TcpDatagramSocket

public TcpDatagramSocket(int nPort,
                         InetAddress addr)
                  throws SocketException
Throws:
SocketException

TcpDatagramSocket

public TcpDatagramSocket(SocketProvider provider)
                  throws IOException
Throws:
IOException

TcpDatagramSocket

protected TcpDatagramSocket(TcpDatagramSocket.Impl impl)

Method Detail

provider

public SelectorProvider provider()
Return the SelectorProvider associated with this socket.
Returns:
the SelectorProvider

setSocketOptions

public void setSocketOptions(SocketOptions options)
Specify SocketOptions to be used to configure each of the underlying TCP sockets.
Parameters:
options - the SocketOptions

setListenBacklog

public void setListenBacklog(int n)
                      throws IOException
Specify the listen backlog for the server socket.
Parameters:
n - the depth of the backlog, or <=0 for the OS default.
Throws:
IOException - if the socket is already bound

setPacketMagic

public void setPacketMagic(int nMagic,
                           int nMask)
                    throws IOException
Specify the packet header which is included at the start of every packet. Because this implementation is TCP based these headers can be stripped off, and replaced on the far side without consuming any network resources.
Parameters:
nMagic - the packet header
nMask - the packet header bitmask identifying the bits used
Throws:
IOException - if the socket is already bound

setAdvanceFrequency

public void setAdvanceFrequency(int nAdvance)
Specify the frequency at which the DatagramSocket will advance over the sub-sockets during receive. A higher value will optimize for throughput as well as latency when communicating with a small number of peers. A low value will optimize for latency when communicating with a large number of peers, but is likely to hurt overall throughput.
Parameters:
nAdvance - the packet frequency at which to advance between peers

bind

public void bind(SocketAddress addr)
          throws SocketException
Overrides:
bind in class DatagramSocket
Throws:
SocketException

isBound

public boolean isBound()
Overrides:
isBound in class DatagramSocket

send

public void send(DatagramPacket p)
          throws IOException
Overrides:
send in class DatagramSocket
Throws:
IOException

receive

public void receive(DatagramPacket p)
             throws IOException
Overrides:
receive in class DatagramSocket
Throws:
IOException

toString

public String toString()

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.